Skip to content
Snippets Groups Projects
Verified Commit 12758a5f authored by Vincent Lafeychine's avatar Vincent Lafeychine
Browse files

clippy: Fix unnecessary_unwrap

parent 6f684890
No related branches found
No related tags found
1 merge request!33Fix most of clippy::complexity and clippy::correctness
......@@ -21,7 +21,6 @@ rustflags = [
"-Aunused_variables",
# clippy::complexity
"-Aclippy::unnecessary_unwrap",
"-Aclippy::useless_conversion",
"-Aclippy::useless_format",
......
......@@ -63,12 +63,11 @@ impl ConstAttrParser for VerboseConstAttrParser {
}
}
}
if name.is_none() {
Err(format!("no name attribute specified on const"))
if let Some(name) = name {
Ok(ConstAttrs { name })
} else {
Ok(ConstAttrs {
name: name.unwrap(),
})
Err(format!("no name attribute specified on const"))
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment