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
@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
@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 This content has been proxied by September (ba2dc).Proxy Information
text/gemini