#![allow(dead_code, deprecated, unused_variables, unused_mut)] use std::cell::OnceCell; fn main() { let mut cell: OnceCell = OnceCell::new(); assert_eq!(cell.take(), None); let mut cell = OnceCell::new(); let _ = cell.set("hello".to_owned()); assert_eq!(cell.take(), Some("hello".to_owned())); assert_eq!(cell.get(), None); }