rust_book_feedback icon indicating copy to clipboard operation
rust_book_feedback copied to clipboard

机械工业版P159 Cell示例, Line 6出现不存的vdata变量

Open huangjj27 opened this issue 7 years ago • 1 comments

use std::cell::Cell;
fn main() {
    let data: Cell<i32> = Cell::new(100);
    let p = &data;
    vdata.set(10);  // `vdata` should be `data`?
    println!("{}", p.get());

    p.set(20);
    println!("{:?}", data);
}

huangjj27 avatar Sep 22 '18 06:09 huangjj27

谢谢,确实如此

F001 avatar Sep 22 '18 06:09 F001