Lifetime weird case

50 · Users Rust Lang · April 23, 2026, 7:24 p.m.
Summary
This post discusses a specific issue faced by the author when dealing with lifetimes in Rust while trying to mutate a vector after borrowing it immutably in a function. The author presents code examples illustrating their confusion about Rust's borrowing rules, particularly around the use of an iterator and the impact of the borrow on subsequent mutability.