Skip to content

Commit

Permalink
fix: clippy (#1774)
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim authored Oct 6, 2023
1 parent 2840466 commit d1ee6c2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/commands/bash_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<String>("tags")
.map(|v| v.collect())
.unwrap_or_else(Vec::new);
.unwrap_or_default();

if matches.get_flag("send_event") {
return send_event(
Expand Down
8 changes: 4 additions & 4 deletions src/commands/files/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
.get_one::<String>("ignore_file")
.map(String::as_str)
.unwrap_or_default();
let ignores = matches
let ignores: Vec<_> = matches
.get_many::<String>("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::<String>("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)
Expand Down
4 changes: 2 additions & 2 deletions src/commands/sourcemaps/inject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
.get_one::<String>("ignore_file")
.map(String::as_str)
.unwrap_or_default();
let ignores = matches
let ignores: Vec<_> = matches
.get_many::<String>("ignore")
.map(|ignores| ignores.map(|i| format!("!{i}")).collect())
.unwrap_or_else(Vec::new);
.unwrap_or_default();

let mut extensions = matches
.get_many::<String>("extensions")
Expand Down
4 changes: 2 additions & 2 deletions src/commands/sourcemaps/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,10 @@ fn process_sources_from_paths(
.get_many::<String>("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::<String>("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());
Expand Down

0 comments on commit d1ee6c2

Please sign in to comment.