Skip to content

Commit 96297f0

Browse files
committed
chore(ci): Clarify why map_or is banned
1 parent 60a8ec8 commit 96297f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.clippy.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ allow-unwrap-in-tests = true
55
allow-dbg-in-tests = true
66
allow-print-in-tests = true
77
disallowed-methods = [
8-
{ path = "std::option::Option::map_or", reason = "use `map(..).unwrap_or(..)`" },
9-
{ path = "std::option::Option::map_or_else", reason = "use `map(..).unwrap_or_else(..)`" },
10-
{ path = "std::result::Result::map_or", reason = "use `map(..).unwrap_or(..)`" },
11-
{ path = "std::result::Result::map_or_else", reason = "use `map(..).unwrap_or_else(..)`" },
8+
{ path = "std::option::Option::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
9+
{ path = "std::option::Option::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
10+
{ path = "std::result::Result::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
11+
{ path = "std::result::Result::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
1212
{ path = "std::iter::Iterator::for_each", reason = "prefer `for` for side-effects" },
1313
{ path = "std::iter::Iterator::try_for_each", reason = "prefer `for` for side-effects" },
1414
]

0 commit comments

Comments
 (0)