// struct Container<'a> { // value: i32, // item: &'a Item, // } // struct Item { // value: i32, // } // impl<'a> Container<'a> { // fn new_by_binding(item: &'a Item) -> Self { // Self { value: 0, item } // } // fn out(&self) -> i32 { // self.value + self.item.value // } // } // impl Item { // fn set(&mut self, value: i32) { // self.value = value; // } // } // fn main() { // let mut item = Item { value: 1 }; // let container = Container::new_by_binding(&item); // println!("{}", container.out()); // item.set(2); // println!("{}", container.out()); // } fn main() { println!("Hello, world!"); }