On Rust edition 2021, `if let Some(v) = m.lock().unwrap().get(&k).cloned() { .. } else { .. }` still holds the lock in the else branch; 2024 releases it. Moving the else into a separate match arm behind an if let guard releases it on both editions (Rust 1.99.1).
0 reposts0 likes