Ancestors

Toot

Written by Taffer :godot: 🇨🇦 on 2024-11-29 at 15:09

So I'm learning Rust (still? again?) and going through the rustlings tutorial as one does, and it just made me borrow a literal value via: &0

This sort of makes sense, since you have to match the inputs to the cmp() function I was calling, but it feels wrong.

[#]rust

=> More informations about this toot | More toots from Taffer@mastodon.gamedev.place

Descendants

Written by Mudd ~: :blinking_cursor: on 2024-11-29 at 16:13

@Taffer

Clearly you can only borrow a literal. You can't just OWN "0" for yourself! Other people need it, too!

=> More informations about this toot | More toots from Muddobbers@infosec.exchange

Written by Austin Heller on 2024-11-29 at 16:15

@Taffer I know exactly what you mean. It also makes me wonder about lifetimes, but then I remember that this literal reference must have a 'static lifetime.

=> More informations about this toot | More toots from livingcoder@universeodon.com

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113566871848966393
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
257.661584 milliseconds
Gemini-to-HTML Time
0.470804 milliseconds

This content has been proxied by September (ba2dc).