mirror of
https://github.com/PacktPublishing/Rust-High-Performance.git
synced 2026-01-25 02:34:19 +09:00
10 lines
213 B
Rust
10 lines
213 B
Rust
use std::cell::Cell;
|
|
|
|
fn main() {
|
|
let my_cell = Cell::new(0);
|
|
println!("Initial cell value: {}", my_cell.get());
|
|
|
|
my_cell.set(my_cell.get() + 1);
|
|
println!("Final cell value: {}", my_cell.get());
|
|
}
|