From 96297f038d8d931bb9d5ba4dfcdced18d7c81061 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 17 Apr 2023 20:04:56 -0500 Subject: [PATCH] chore(ci): Clarify why map_or is banned --- .clippy.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.clippy.toml b/.clippy.toml index 56d269a..22fe10b 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -5,10 +5,10 @@ allow-unwrap-in-tests = true allow-dbg-in-tests = true allow-print-in-tests = true disallowed-methods = [ - { path = "std::option::Option::map_or", reason = "use `map(..).unwrap_or(..)`" }, - { path = "std::option::Option::map_or_else", reason = "use `map(..).unwrap_or_else(..)`" }, - { path = "std::result::Result::map_or", reason = "use `map(..).unwrap_or(..)`" }, - { path = "std::result::Result::map_or_else", reason = "use `map(..).unwrap_or_else(..)`" }, + { path = "std::option::Option::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" }, + { path = "std::option::Option::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" }, + { path = "std::result::Result::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" }, + { path = "std::result::Result::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" }, { path = "std::iter::Iterator::for_each", reason = "prefer `for` for side-effects" }, { path = "std::iter::Iterator::try_for_each", reason = "prefer `for` for side-effects" }, ]