You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `unwrap` function must not be used in any fallible code paths.
540
+
The `unwrap` function must not be used in any code.
541
541
Instead, proper error handling like above should be used, unless there is a valid reason to use `expect` described below.
542
542
Using link:{unwrap_or}[`unwrap_or`], link:{unwrap_or_default}[`unwrap_or_default`] or link:{unwrap_or_else}[`unwrap_or_else`] is allowed because these functions will not panic.
543
543
@@ -788,7 +788,7 @@ The usage of `unwrap` in unit tests is also not allowed for the same reasons as
788
788
----
789
789
#[test]
790
790
fn deserialize() {
791
-
let input: String = serde_yaml::from_str("my string").expect("input string must deserialize");
791
+
let input: String = serde_yaml::from_str("my string").expect("constant input string must deserialize");
0 commit comments