From 5d740c9e81073fcf831b01607f7b428acdc810f2 Mon Sep 17 00:00:00 2001 From: Shawn Napora <17864647+shawnnapora@users.noreply.github.com> Date: Tue, 26 Jul 2022 17:29:10 -0400 Subject: [PATCH] Update exercise to be clearer (#1573) --- src/hello/print.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hello/print.md b/src/hello/print.md index dd32a918f0..46251ac193 100644 --- a/src/hello/print.md +++ b/src/hello/print.md @@ -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 @@ -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