}
impl Drop for X {
- fn drop(&self) {
- error!("value: %s", self.x);
+ fn drop(&mut self) {
+ println!("value: {}", self.x);
}
}
}
fn main() {
- let x = X { x: ~"hello" };
+ let x = X { x: "hello".to_owned() };
let y = unwrap(x);
- error!("contents: %s", y);
+ println!("contents: {}", y);
}