-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-lintArea: New lintsArea: New lintsL-styleLint: Belongs in the style lint groupLint: Belongs in the style lint groupT-ASTType: Requires working with the ASTType: Requires working with the AST
Description
Use a single if let
instead of a nested one whenever possible:
let value = Some(Err("Some error"));
if let Some(Err(ref error)) = value { // TODO
return Err(format!("Error parsing 'value': {}", error));
}
Instead of:
let value = Some(Err("Some error"));
if let Some(ref result) = value {
if let Err(ref error) = *result {
return Err(format!("Error parsing 'value': {}", error));
}
}
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsL-styleLint: Belongs in the style lint groupLint: Belongs in the style lint groupT-ASTType: Requires working with the ASTType: Requires working with the AST