rust/src/test/run-pass/format-ref-cell.rs
2018-12-25 21:08:33 -07:00

9 lines
240 B
Rust

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());
}