diff --git a/exercises/13_error_handling/errors1.rs b/exercises/13_error_handling/errors1.rs index 6d9701b1..ec7cb3cb 100644 --- a/exercises/13_error_handling/errors1.rs +++ b/exercises/13_error_handling/errors1.rs @@ -32,9 +32,10 @@ mod tests { #[test] fn explains_why_generating_nametag_text_fails() { assert_eq!( - generate_nametag_text(String::new()).as_deref(), - // Don't change this line - Err("`name` was empty; it must be nonempty."), + generate_nametag_text(String::new()) + .as_ref() + .map_err(|e| e.as_str()), + Err("Empty names aren't allowed"), ); } } diff --git a/solutions/13_error_handling/errors1.rs b/solutions/13_error_handling/errors1.rs index 2a13bfdd..f552ca7f 100644 --- a/solutions/13_error_handling/errors1.rs +++ b/solutions/13_error_handling/errors1.rs @@ -28,8 +28,10 @@ mod tests { #[test] fn explains_why_generating_nametag_text_fails() { assert_eq!( - generate_nametag_text(String::new()).as_deref(), - Err("`name` was empty; it must be nonempty."), + generate_nametag_text(String::new()) + .as_ref() + .map_err(|e| e.as_str()), + Err("Empty names aren't allowed"), ); } }