Skip to content

Commit

Permalink
apply cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tokiedokie committed Jun 3, 2020
1 parent 99adc13 commit 911ee40
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "scoop-search"
version = "0.5.7"
version = "0.5.8"
authors = ["tokiedokie <42903136+tokiedokie@users.noreply.github.com>"]
edition = "2018"

Expand Down
5 changes: 1 addition & 4 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ impl App {

let filtered: Vec<App> = tree
.as_array()
.ok_or_else(|| Box::<dyn Error>::from(format!(
"{} key `tree` is invalid",
remote_url
)))?
.ok_or_else(|| Box::<dyn Error>::from(format!("{} key `tree` is invalid", remote_url)))?
.iter()
.map(|obj| obj["path"].as_str().unwrap_or("").to_string())
.filter(|path| path.ends_with(".json"))
Expand Down
4 changes: 2 additions & 2 deletions src/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ impl Bucket {
let mut app_in_local = false;

for bucket_path in bucket_paths {
let bucket_name = Bucket::get_name(&bucket_path).unwrap_or(String::new());
let bucket_name = Bucket::get_name(&bucket_path).unwrap_or_default();
let app_paths = App::get_app_paths(&bucket_path)?;

let apps: Vec<App> = app_paths.iter().map(|path| App::new(path)).collect();

let filtered_apps = App::search_apps(&apps, query);

if filtered_apps.len() > 0 {
if !filtered_apps.is_empty() {
app_in_local = true;
crate::display_apps(&bucket_name, &filtered_apps);
}
Expand Down
2 changes: 1 addition & 1 deletion src/scoop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Scoop {
//Ok(config.get("rootPath").is_some())
Ok(config
.get("rootPath")
.ok_or(Box::<dyn Error>::from(
.ok_or_else(|| Box::<dyn Error>::from(
"Can't get rootPath in scoop/config.json",
))?
.to_string())
Expand Down

0 comments on commit 911ee40

Please sign in to comment.