-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
A-lintArea: New lintsArea: New lintsL-unnecessaryLint: Warn about unnecessary codeLint: Warn about unnecessary codeT-middleType: Probably requires verifiying typesType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
It woud be nice if clippy could detect situations where map()
is being used unnecessarily to pass a contained value wrapped as either a Result or an Option.
Unnecessarry
let mut file = File::open(path)
.map(|file| file)
.unwrap_or_else(|why| panic!("couldn't open {}: {}", infilename, why));
Recommended
let mut file = File::open(infilename)
.unwrap_or_else(|why| panic!("couldn't open {}: {}", infilename, why));
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsL-unnecessaryLint: Warn about unnecessary codeLint: Warn about unnecessary codeT-middleType: Probably requires verifiying typesType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy