2026-07-17 10:13 UTC
Note to self: in #rustlang, you convert an Option<String> in a Option<&String> with the method as_ref, and for the conversion Option<String> to Option<&str>, use as_deref.
Damn, I have a hard time memorising these method names. Same for Option::ok_or.
Absolutely not intuitive to me.
Replies (0)
No replies.