You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-05 06:00:30 +02:00
Use dbg! instead of println! in day 3 & 4. (#2669)
Part of #2478 to clean up code blocks when all that is needed is a trivial debug print statement. Co-authored-by: Eric Githinji <egithinji@google.com>
This commit is contained in:
@ -11,7 +11,7 @@ Rust will trigger a panic if a fatal error happens at runtime:
|
||||
```rust,editable,should_panic
|
||||
fn main() {
|
||||
let v = vec![10, 20, 30];
|
||||
println!("v[100]: {}", v[100]);
|
||||
dbg!(v[100]);
|
||||
}
|
||||
```
|
||||
|
||||
@ -33,12 +33,12 @@ use std::panic;
|
||||
|
||||
fn main() {
|
||||
let result = panic::catch_unwind(|| "No problem here!");
|
||||
println!("{result:?}");
|
||||
dbg!(result);
|
||||
|
||||
let result = panic::catch_unwind(|| {
|
||||
panic!("oh no!");
|
||||
});
|
||||
println!("{result:?}");
|
||||
dbg!(result);
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user