Move to using clippy (#1142)

* Clippy fixes

* Finish converting to use clippy

* fix warnings in new master

* fix windows

* fix windows

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
This commit is contained in:
Jonathan Turner
2019-12-31 20:36:08 +13:00
committed by GitHub
parent 8093612cac
commit 72838cc083
93 changed files with 754 additions and 852 deletions

View File

@ -100,18 +100,18 @@ async fn fetch_helper(path: &Value, has_raw: bool, row: Value) -> ReturnValue {
} else {
// If the extension could not be determined via mimetype, try to use the path
// extension. Some file types do not declare their mimetypes (such as bson files).
file_extension.or(path_str.split('.').last().map(String::from))
file_extension.or_else(|| path_str.split('.').last().map(String::from))
};
let tagged_contents = contents.retag(&contents_tag);
if let Some(extension) = file_extension {
return Ok(ReturnSuccess::Action(CommandAction::AutoConvert(
Ok(ReturnSuccess::Action(CommandAction::AutoConvert(
tagged_contents,
extension,
)));
)))
} else {
return ReturnSuccess::value(tagged_contents);
ReturnSuccess::value(tagged_contents)
}
}