You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-06 06:27:53 +02:00
Use dbg! instead of println! in Day 2. (#2657)
Part of #2478 to clean up code blocks when all that is needed is a trivial debug print statement. As mentioned in previous related PRs, in some places I've opted to retain the use of println! because dbg! makes it less readable. Co-authored-by: Eric Githinji <egithinji@google.com>
This commit is contained in:
@ -35,7 +35,7 @@ fn main() {
|
||||
*page_count += 1;
|
||||
}
|
||||
|
||||
println!("{page_counts:#?}");
|
||||
dbg!(page_counts);
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -13,10 +13,10 @@ returns an `Option<usize>`.
|
||||
fn main() {
|
||||
let name = "Löwe 老虎 Léopard Gepardi";
|
||||
let mut position: Option<usize> = name.find('é');
|
||||
println!("find returned {position:?}");
|
||||
dbg!(position);
|
||||
assert_eq!(position.unwrap(), 14);
|
||||
position = name.find('Z');
|
||||
println!("find returned {position:?}");
|
||||
dbg!(position);
|
||||
assert_eq!(position.expect("Character not found"), 0);
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user