Skip to content

Commit 7dc644e

Browse files
chore: Apply suggestions from code review
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
1 parent 6a169fb commit 7dc644e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/contributor/pages/code-style-guide.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ enum Error {
537537
:unwrap_or_default: https://doc.rust-lang.org/std/result/enum.Result.html#method.unwrap_or_default
538538
:unwrap_or_else: https://doc.rust-lang.org/std/result/enum.Result.html#method.unwrap_or_else
539539

540-
The `unwrap` function must not be used in any fallible code paths.
540+
The `unwrap` function must not be used in any code.
541541
Instead, proper error handling like above should be used, unless there is a valid reason to use `expect` described below.
542542
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.
543543

@@ -788,7 +788,7 @@ The usage of `unwrap` in unit tests is also not allowed for the same reasons as
788788
----
789789
#[test]
790790
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");
792792
assert_eq(&input, "my string");
793793
}
794794
----

0 commit comments

Comments
 (0)