diff --git a/src/commands/bash_hook.rs b/src/commands/bash_hook.rs index 4a9bb71d3e..3597b7a22c 100644 --- a/src/commands/bash_hook.rs +++ b/src/commands/bash_hook.rs @@ -207,10 +207,10 @@ fn send_event( pub fn execute(matches: &ArgMatches) -> Result<()> { let release = Config::current().get_release(matches).ok(); - let tags = matches + let tags: Vec<_> = matches .get_many::("tags") .map(|v| v.collect()) - .unwrap_or_else(Vec::new); + .unwrap_or_default(); if matches.get_flag("send_event") { return send_event( diff --git a/src/commands/files/upload.rs b/src/commands/files/upload.rs index a5541b3daa..d16d044f57 100644 --- a/src/commands/files/upload.rs +++ b/src/commands/files/upload.rs @@ -164,14 +164,14 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { .get_one::("ignore_file") .map(String::as_str) .unwrap_or_default(); - let ignores = matches + let ignores: Vec<_> = matches .get_many::("ignore") .map(|ignores| ignores.map(|i| format!("!{i}")).collect()) - .unwrap_or_else(Vec::new); - let extensions = matches + .unwrap_or_default(); + let extensions: Vec<_> = matches .get_many::("extensions") .map(|extensions| extensions.map(|ext| ext.trim_start_matches('.')).collect()) - .unwrap_or_else(Vec::new); + .unwrap_or_default(); let sources = ReleaseFileSearch::new(path.to_path_buf()) .ignore_file(ignore_file) diff --git a/src/commands/sourcemaps/inject.rs b/src/commands/sourcemaps/inject.rs index efde84040f..355844c117 100644 --- a/src/commands/sourcemaps/inject.rs +++ b/src/commands/sourcemaps/inject.rs @@ -81,10 +81,10 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { .get_one::("ignore_file") .map(String::as_str) .unwrap_or_default(); - let ignores = matches + let ignores: Vec<_> = matches .get_many::("ignore") .map(|ignores| ignores.map(|i| format!("!{i}")).collect()) - .unwrap_or_else(Vec::new); + .unwrap_or_default(); let mut extensions = matches .get_many::("extensions") diff --git a/src/commands/sourcemaps/upload.rs b/src/commands/sourcemaps/upload.rs index 2c36770496..7a50c68cb1 100644 --- a/src/commands/sourcemaps/upload.rs +++ b/src/commands/sourcemaps/upload.rs @@ -329,10 +329,10 @@ fn process_sources_from_paths( .get_many::("extensions") .map(|extensions| extensions.map(|ext| ext.trim_start_matches('.')).collect()) .unwrap_or_else(|| vec!["js", "map", "jsbundle", "bundle"]); - let ignores = matches + let ignores: Vec<_> = matches .get_many::("ignore") .map(|ignores| ignores.map(|i| format!("!{i}")).collect()) - .unwrap_or_else(Vec::new); + .unwrap_or_default(); let opts = MatchOptions::new(); let collected_paths = paths.flat_map(|path| glob_with(path, opts).unwrap().flatten());