#![allow(dead_code, deprecated, unused_variables, unused_mut)] #![feature(lazy_cell_into_inner)] use std::cell::LazyCell; fn main() { let hello = "Hello, World!".to_string(); let lazy = LazyCell::new(|| hello.to_uppercase()); assert_eq!(&* lazy, "HELLO, WORLD!"); assert_eq!(LazyCell::into_inner(lazy).ok(), Some("HELLO, WORLD!".to_string())); }