Skip to content

Commit

Permalink
update some usage of println! to dbg!
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemorris committed Aug 28, 2021
1 parent 255a638 commit 440cd26
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/ch08-03-hash-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ let mut scores = HashMap::new();
scores.insert(String::from("Blue"), 10);
scores.insert(String::from("Blue"), 25);

println!("{:?}", scores);
dbg!(scores);
```

<span class="caption">Listing 8-24: Replacing a value stored with a particular
Expand Down Expand Up @@ -208,7 +208,7 @@ scores.insert(String::from("Blue"), 10);
scores.entry(String::from("Yellow")).or_insert(50);
scores.entry(String::from("Blue")).or_insert(50);

println!("{:?}", scores);
dbg!(scores);
```

<span class="caption">Listing 8-25: Using the `entry` method to only insert if
Expand Down Expand Up @@ -247,7 +247,7 @@ for word in text.split_whitespace() {
*count += 1;
}

println!("{:?}", map);
dbg!(map);
```

<span class="caption">Listing 8-26: Counting occurrences of words using a hash
Expand Down
2 changes: 1 addition & 1 deletion src/ch12-01-accepting-command-line-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use std::env;

fn main() {
let args: Vec<String> = env::args().collect();
println!("{:?}", args);
dbg!(args);
}
```

Expand Down
2 changes: 1 addition & 1 deletion src/ch16-03-shared-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn main() {
*num = 6;
}

println!("m = {:?}", m);
dbg!(m);
}
```

Expand Down
6 changes: 3 additions & 3 deletions src/ch18-03-pattern-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ match (setting_value, new_setting_value) {
}
}

println!("setting is {:?}", setting_value);
dbg!(setting_value);
```

<span class="caption">Listing 18-18: Using an underscore within patterns that
Expand Down Expand Up @@ -538,7 +538,7 @@ if let Some(_s) = s {
println!("found a string");
}
println!("{:?}", s);
dbg!(s);
```

<span class="caption">Listing 18-21: An unused variable starting with an
Expand All @@ -556,7 +556,7 @@ if let Some(_) = s {
println!("found a string");
}

println!("{:?}", s);
dbg!(s);
```

<span class="caption">Listing 18-22: Using an underscore does not bind the
Expand Down

0 comments on commit 440cd26

Please sign in to comment.