You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the note to add here is that whilst you can return a slice with static lifetime, the borrow checker can only assume the lifetime of the output is tied to the lifetime of the input, so you must drop the returned slice before dropping the input slice, even if you did return "abc".
Slide code: https://github.com/ferrous-systems/rust-training/blob/main/training-slides/src/lifetimes.md?plain=1#L95
This function CAN return local data
The text was updated successfully, but these errors were encountered: