You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-07 06:55:42 +02:00
Use dbg! instead of println! in Day 1 aft session (#2654)
Part of #2478 to clean up code blocks when all that is needed is a trivial debug print statement. In certain slides (8.1, 9.2, 9.3, 10.5) I've opted to retain the use of println! because dbg! makes it less readable. The dbg! macro uses pretty-printing by default and this results in a simple array such as the one in 8.1 being printed vertically instead of a cleaner one-liner. Co-authored-by: Eric Githinji <egithinji@google.com>
This commit is contained in:
@ -33,9 +33,9 @@ fn main() {
|
||||
[301, 302, 303],
|
||||
];
|
||||
|
||||
println!("matrix: {:#?}", matrix);
|
||||
dbg!(matrix);
|
||||
let transposed = transpose(matrix);
|
||||
println!("transposed: {:#?}", transposed);
|
||||
dbg!(transposed);
|
||||
}
|
||||
// ANCHOR_END: main
|
||||
// ANCHOR_END: solution
|
||||
|
@ -9,8 +9,8 @@ minutes: 5
|
||||
```rust,editable
|
||||
fn main() {
|
||||
let t: (i8, bool) = (7, true);
|
||||
println!("t.0: {}", t.0);
|
||||
println!("t.1: {}", t.1);
|
||||
dbg!(t.0);
|
||||
dbg!(t.1);
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user