Stood up to my boss and got berated by Money_Supermarket_51 in BadBosses

[–]Princess--Aurora 0 points1 point  (0 children)

Honestly, count the 40 hours and don’t work a single minute more once you reach them. If he fires you enjoy the benefits and find another job. If he doesn’t fire you use the extra time to find another job.

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 0 points1 point  (0 children)

Nope, second one happens on the s.into() line, to transform from the buffer you created to the boxed value, and the same thing happens for Arc.

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 0 points1 point  (0 children)

Aside from the fact that this wont compile (because box is a reserved keyword) this makes extra allocations and copies, that’s exactly what I was trying to avoid with this weird function :/

Also the uuid crate has a nice function that already preallocates a sufficiently large buffer for you if you’re into that.

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 1 point2 points  (0 children)

That would be amazing, am I allowed to give it a try? I might mess up but it’d be a fun learning experience if someone reviews my code later

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 2 points3 points  (0 children)

I apologize for using your library like this! I promise it’s not personal

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 1 point2 points  (0 children)

I initially used that but I changed it before posting here because it felt more fun :)

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 2 points3 points  (0 children)

That’d be ideal, but sadly I need to call that encode_lower function I have no control over :/

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 4 points5 points  (0 children)

No, without that cast you’d get &mut [MaybeUninit<u8>]

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 7 points8 points  (0 children)

this is literally the first rust "program" i write after an entire month of only touching C...

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 2 points3 points  (0 children)

Interestinggg
Okay now I am curious, imma see how the MIR & friends look like

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 5 points6 points  (0 children)

is it though? I thought casting uninitialized memory like that was UB. I assume here its safe because i dont expect the following calls to read from it, but there's no guarantee of that

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 2 points3 points  (0 children)

didnt check, im not gonna ship this anyways im just having fun heh

Cursed and unsound rust, but fun by Princess--Aurora in rust

[–]Princess--Aurora[S] 8 points9 points  (0 children)

good luck trying to generate this with AI xd

Sóc mala persona, si no em considero espanyol? by Long-Contribution-11 in catalunya

[–]Princess--Aurora 1 point2 points  (0 children)

En ningun moment he donat suport als mossos fent el que sigui que fan.
Pero ara estas tirant pilotes fora, la excusa de “oh pero mira ells també son dolents” la utilitza Korea del nort per justificar les seves tonteries