Should rust be letting me do this?
$ cargo run
Compiling test-irc v0.0.1 (file:///home/daboross/Projects/Rust/Learn/test-irc)
Running `target/test-irc`
Cloning
An unknown error occurred
To learn more, run the command again with --verbose.
struct Client { | |
option: Option<String>, | |
} | |
fn main() { | |
let mut client = Client { | |
option: Some("address".into_string()) | |
}; | |
let address = match client.option { | |
Some(v) => { | |
client.option = None; | |
v | |
}, | |
None => return | |
}; | |
println!("Cloning") | |
address.clone(); | |
} |