Skip to content

Commit 3923974

Browse files
committed
rename add_to_count to add_to_counter (more meaningful)
1 parent 6511d80 commit 3923974

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

c19_unsafe/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static HELLO_WORLD: &str = "Hello world!";
4141

4242
// mutable global static variable
4343
static mut COUNTER: u32 = 0;
44-
fn add_to_count(inc: u32) {
44+
fn add_to_counter(inc: u32) {
4545
// mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
4646
// so must be within unsafe block.
4747
unsafe {
@@ -123,7 +123,7 @@ fn main() {
123123
// so must be within unsafe block.
124124
println!("Counter is {COUNTER}");
125125
}
126-
add_to_count(3);
126+
add_to_counter(3);
127127
unsafe {
128128
// mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
129129
// so must be within unsafe block.

0 commit comments

Comments
 (0)