Skip to content

Instantly share code, notes, and snippets.

@dinfuehr
dinfuehr / error.rs
Created January 26, 2015 09:03
Rust: cannot move out of borrowed content
struct Foo {
value: String
}
impl Foo {
fn test(&mut self) -> String {
let old = self.value;
self.value = "new".to_string();
old
}