Skip to content

Commit 440cd26

Browse files
committed
update some usage of println! to dbg!
1 parent 255a638 commit 440cd26

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/ch08-03-hash-maps.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ let mut scores = HashMap::new();
179179
scores.insert(String::from("Blue"), 10);
180180
scores.insert(String::from("Blue"), 25);
181181

182-
println!("{:?}", scores);
182+
dbg!(scores);
183183
```
184184

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

211-
println!("{:?}", scores);
211+
dbg!(scores);
212212
```
213213

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

250-
println!("{:?}", map);
250+
dbg!(map);
251251
```
252252

253253
<span class="caption">Listing 8-26: Counting occurrences of words using a hash

src/ch12-01-accepting-command-line-arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use std::env;
4545

4646
fn main() {
4747
let args: Vec<String> = env::args().collect();
48-
println!("{:?}", args);
48+
dbg!(args);
4949
}
5050
```
5151

src/ch16-03-shared-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn main() {
6464
*num = 6;
6565
}
6666

67-
println!("m = {:?}", m);
67+
dbg!(m);
6868
}
6969
```
7070

src/ch18-03-pattern-syntax.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ match (setting_value, new_setting_value) {
464464
}
465465
}
466466

467-
println!("setting is {:?}", setting_value);
467+
dbg!(setting_value);
468468
```
469469

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

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

559-
println!("{:?}", s);
559+
dbg!(s);
560560
```
561561

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

0 commit comments

Comments
 (0)