From 54dc13ebf60b66a59eb322a8b215de269d9ba615 Mon Sep 17 00:00:00 2001 From: Grumme2 <agh@live.se> Date: Thu, 20 Feb 2020 14:21:25 +0100 Subject: [PATCH] bare0_4 --- examples/bare0.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/bare0.rs b/examples/bare0.rs index c423a06..dc52864 100644 --- a/examples/bare0.rs +++ b/examples/bare0.rs @@ -42,7 +42,7 @@ fn main() -> ! { unsafe { X = X.wrapping_add(1); Y = X; - assert!(x == X && X == Y); + assert!(x == X && X == Y+1); } } } @@ -106,7 +106,7 @@ fn main() -> ! { // 4. Change the assertion to `assert!(x == X && X == Y + 1)`, what happens? // // ** place your answer here ** -// +// the program panics "panicked at 'assertion failed: x == X && X == Y + 1', examples/bare0.rs:45:13" // Commit your answers (bare0_4) // // 5. Remove the assertion and implement "safe" functions for -- GitLab