Cannot move out of borrowed content when unwrapping
问题 This is the code I am trying to execute: fn my_fn(arg1: &Option<Box<i32>>) -> (i32) { if arg1.is_none() { return 0; } let integer = arg1.unwrap(); *integer } fn main() { let integer = 42; my_fn(&Some(Box::new(integer))); } (on the Rust playground) I get the following error: error[E0507]: cannot move out of borrowed content --> src/main.rs:5:19 | 5 | let integer = arg1.unwrap(); | ^^^^ cannot move out of borrowed content I see there is already a lot of documentation about borrow checker issues