fix logic for logging step 5, output should now trigger two errors in a row
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user