forked from google/comprehensive-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use dbg! instead of println! in Day 1 mng session (google#2652)
As mentioned in google#2478, this cleans up the code blocks when all that is needed is a trivial debug print statement. Only making changes to Day 1 morning session so that I can get feedback before proceeding with the rest of the course. --------- Co-authored-by: Eric Githinji <[email protected]>
- Loading branch information
Showing
7 changed files
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ fn main() { | |
if i % 2 == 0 { | ||
continue; | ||
} | ||
println!("{}", i); | ||
dbg!(i); | ||
} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ fn main() { | |
} | ||
} | ||
} | ||
print!("elements searched: {elements_searched}"); | ||
dbg!(elements_searched); | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,6 @@ fn main() { | |
while x >= 10 { | ||
x = x / 2; | ||
} | ||
println!("Final x: {x}"); | ||
dbg!(x); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ fn main() { | |
let mut i = 0; | ||
loop { | ||
i += 1; | ||
println!("{i}"); | ||
dbg!(i); | ||
if i > 100 { | ||
break; | ||
} | ||
|