diff --git a/exercise/logging/src/lib.rs b/exercise/logging/src/lib.rs index 3b447f6..95475de 100644 --- a/exercise/logging/src/lib.rs +++ b/exercise/logging/src/lib.rs @@ -26,8 +26,9 @@ impl Frog { } } pub fn sleep(&mut self) { - if !self.sleeping { + if self.sleeping { // 5. Use error!() to log a (non-fatal) error stating that the Frog is already asleep + } else { self.sleeping = true; } } diff --git a/exercise/logging/src/main.rs b/exercise/logging/src/main.rs index c4f1161..4d03774 100644 --- a/exercise/logging/src/main.rs +++ b/exercise/logging/src/main.rs @@ -19,6 +19,7 @@ fn main() { skippy.hop(); skippy.hop(); skippy.sleep(); + skippy.sleep(); // Challenge: Go back to lib.rs and set the `target: ` argument for each logging call to be the // path to the function. For example, `Frog::new`