843
submitted 9 months ago* (last edited 9 months ago) by MaliciousKebab@sh.itjust.works to c/programmer_humor@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] Gobbel2000@feddit.de 133 points 9 months ago

Rust:

Cannot move princess out of castle which is behind a shared reference

[-] magic_lobster_party@kbin.social 71 points 9 months ago

You can’t rescue the princess, but you can borrow her.

[-] cactusupyourbutt@lemmy.world 14 points 9 months ago

…good enough.

Ill get her back in 3 minutes

[-] Octopus1348@lemy.lol 37 points 9 months ago

It will also complain that trying to break into the castle is unsafe, so you have to tell it that you know.

[-] Rodeo@lemmy.ca 11 points 9 months ago

That just means you designed your castle unsafely.

[-] CanadaPlus@futurology.today 8 points 9 months ago* (last edited 9 months ago)

"Alright, but you better be outside of a properly locked up and OSHA-compliant castle with the princess by the time I get back, or I'm not compiling"

And then you do that, but you miss a smoldering ember from one of the castles torches, and everything including the horse and princess catches fire. Next time, pick an escape plan that only requires unsafe for the drawbridge.

There's a totally safe way to do it too, I guess, but it involves building a series of replacement castles, and it's also totally ugly and sinfully slow.

[-] marcos@lemmy.world 5 points 9 months ago

Just clone the princes and get on with your day.

[-] wolo 1 points 8 months ago

You can use std::mem::swap to get ownership of the princess, but you need another princess to fill her place in the tower.

this post was submitted on 07 Dec 2023
843 points (100.0% liked)

Programmer Humor

19176 readers
907 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS