Skip to content

Commit

Permalink
Update exercise to be clearer (#1573)
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnnapora authored Jul 26, 2022
1 parent af111ee commit 5d740c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hello/print.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ fn main() {
// This will not compile because `Structure` does not implement
// fmt::Display
println!("This struct `{}` won't print...", Structure(3));
// FIXME ^ Comment out this line.
//println!("This struct `{}` won't print...", Structure(3));
// TODO ^ Try uncommenting this line
// For Rust 1.58 and above, you can directly capture the argument from a
// surrounding variable. Just like the above, this will output
Expand All @@ -88,8 +88,9 @@ Implementing the `fmt::Display` trait automatically implements the

### Activities

* Fix the two issues in the above code (see FIXME) so that it runs without
* Fix the issue in the above code (see FIXME) so that it runs without
error.
* Try uncommenting the line that attempts to format the `Structure` struct (see TODO)
* Add a `println!` macro call that prints: `Pi is roughly 3.142` by controlling
the number of decimal places shown. For the purposes of this exercise,
use `let pi = 3.141592` as an estimate for pi. (Hint: you may need to
Expand Down

0 comments on commit 5d740c9

Please sign in to comment.