rust/src/test/ui/format-ref-cell.rs
2019-07-27 18:56:16 +03:00

10 lines
253 B
Rust

// run-pass
use std::cell::RefCell;
pub fn main() {
let name = RefCell::new("rust");
let what = RefCell::new("rocks");
let msg = format!("{name} {}", &*what.borrow(), name=&*name.borrow());
assert_eq!(msg, "rust rocks".to_string());
}