siriusmart

joined 3 years ago
308
submitted 2 weeks ago* (last edited 2 weeks ago) by siriusmart@lemmy.world to c/lemmyshitpost@lemmy.world
[–] siriusmart@lemmy.world 3 points 2 weeks ago

that looked like a univiersity library to me

[–] siriusmart@lemmy.world 8 points 3 months ago (1 children)

i've edited the post content for context, and a small puzzle for rust programmers

442
submitted 3 months ago* (last edited 3 months ago) by siriusmart@lemmy.world to c/programmer_humor@programming.dev
 

made in gimp, with <3

Context for actual rust programmersI was having massive beef with the rust compiler yesterday, every cargo check takes 20 seconds.

And then look at the three functions below, only one of them are Send, if you know why, please let me know.

(Note: value that is not Send cannot be held across an await point, and Box is not Send)

async fn one() {
    let res: Result<(), Box<dyn Error>> = do_stuff();
    if let Err(err) = res {
        let content = err.to_string();
        let _ = do_stuff(content).await;
    }
}

async fn two() {
    let res: Result<(), Box<dyn Error>> = do_stuff();
    let content = if let Err(err) = res {
        Some(err.to_string())
    } else {
        None
    };
    drop(res);
    if let Some(content) = content {
        let _ = do_stuff(content).await;
    }
}

async fn three() {
    let content = {
        let res: Result<(), Box<dyn Error>> = do_stuff();
        if let Err(err) = res {
            Some(err.to_string())
        } else {
            None
        }
    };
    if let Some(content) = content {
        let _ = do_stuff(content).await;
    }
}

[–] siriusmart@lemmy.world 2 points 8 months ago (1 children)

i was trying to say this command

mkdir union
cp -rf A/* union
cp -rf B/* union

would create the union folder

[–] siriusmart@lemmy.world 2 points 8 months ago (2 children)

oh 8 is the axiom of infinity, 4 is the pair set axiom

 
 
view more: next ›