From 8f5fd5c61c00b4ead9a815b40ba5bab2119e8c92 Mon Sep 17 00:00:00 2001 From: Alexander Gil Date: Fri, 24 May 2024 08:53:33 +0200 Subject: [PATCH 1/2] feat(ci): Add automerge in patch versions for renovate --- renovate.json5 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/renovate.json5 b/renovate.json5 index 26c57fe4..85b169ae 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -6,5 +6,14 @@ matchPackagePatterns: ".*", commitMessagePrefix: "build(deps): ", }, + { + matchManagers: ["github-actions"], + matchUpdateTypes: ["patch"], + matchCurrentVersion: "!/^0/", + automerge: true, + automergeType: "pr", + ignoreTests: true, + platformAutomerge: true, + }, ], } From f338b50332fd83d26cfd3a62247c9d21a6d8f2f3 Mon Sep 17 00:00:00 2001 From: Alexander Gil Date: Fri, 24 May 2024 08:58:46 +0200 Subject: [PATCH 2/2] fix: Cargo clippy warnings Signed-off-by: Alexander Gil --- rash_core/src/docopt/mod.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rash_core/src/docopt/mod.rs b/rash_core/src/docopt/mod.rs index ecb88f70..989762c3 100644 --- a/rash_core/src/docopt/mod.rs +++ b/rash_core/src/docopt/mod.rs @@ -266,7 +266,7 @@ fn repeat_until_fill( } } -fn is_usage(possible_usage: &str, opts: &Vec<&str>) -> bool { +fn is_usage(possible_usage: &str, opts: &[&str]) -> bool { let possible_usage_opts = possible_usage .split(' ') .filter(|x| !x.contains(['(', '[', ']', ')'])) @@ -276,7 +276,7 @@ fn is_usage(possible_usage: &str, opts: &Vec<&str>) -> bool { possible_usage_opts.len() <= opts.len() && possible_usage_opts.iter().all(|x| opts.contains(x)) } -fn expand_usages(usages: HashSet, args_len: usize, opts: &Vec<&str>) -> HashSet { +fn expand_usages(usages: HashSet, args_len: usize, opts: &[&str]) -> HashSet { let mut new_usages = HashSet::new(); let mut usages_iter: Box> = Box::new(usages.into_iter()); @@ -1273,7 +1273,7 @@ Foo: fn test_expand_usages() { let usages = HashSet::from(["foo ((a | b) (c | d))".to_owned()]); - let result = expand_usages(usages, 2, &vec![]); + let result = expand_usages(usages, 2, &[]); assert_eq!( result, HashSet::from([ @@ -1289,7 +1289,7 @@ Foo: fn test_expand_usages_or() { let usages = HashSet::from(["foo -h | --help".to_owned()]); - let result = expand_usages(usages, 2, &vec!["--help"]); + let result = expand_usages(usages, 2, &["--help"]); assert_eq!( result, HashSet::from(["foo -h".to_owned(), "foo --help".to_owned(),]) @@ -1300,7 +1300,7 @@ Foo: fn test_expand_usages_or_without_space() { let usages = HashSet::from(["foo -h|--help".to_owned()]); - let result = expand_usages(usages, 2, &vec!["--help"]); + let result = expand_usages(usages, 2, &["--help"]); assert_eq!( result, HashSet::from(["foo -h".to_owned(), "foo --help".to_owned(),]) @@ -1311,7 +1311,7 @@ Foo: fn test_expand_usages_all() { let usages = HashSet::from(["foo [(-d | --no-deps)] [(-d | --no-deps)]".to_owned()]); - let result = expand_usages(usages, 2, &vec!["--no-deps", "--no-deps"]); + let result = expand_usages(usages, 2, &["--no-deps", "--no-deps"]); assert_eq!( result, HashSet::from([ @@ -1326,7 +1326,7 @@ Foo: fn test_expand_usages_all_bad() { let usages = HashSet::from(["foo [(-d | --no-deps) (-d | --no-deps)]".to_owned()]); - let result = expand_usages(usages, 2, &vec!["--no-deps", "--no-deps"]); + let result = expand_usages(usages, 2, &["--no-deps", "--no-deps"]); assert_eq!( result, HashSet::from(["foo".to_owned(), "foo --no-deps --no-deps".to_owned(),]) @@ -1337,7 +1337,7 @@ Foo: fn test_expand_usages_tree() { let usages = HashSet::from(["foo (a | b | c)".to_owned()]); - let result = expand_usages(usages, 1, &vec![]); + let result = expand_usages(usages, 1, &[]); assert_eq!( result, HashSet::from(["foo a".to_owned(), "foo b".to_owned(), "foo c".to_owned(),]) @@ -1348,7 +1348,7 @@ Foo: fn test_expand_usages_optional() { let usages = HashSet::from(["foo a [b] c".to_owned()]); - let result = expand_usages(usages, 3, &vec![]); + let result = expand_usages(usages, 3, &[]); assert_eq!( result, HashSet::from(["foo a b c".to_owned(), "foo a c".to_owned(),]) @@ -1359,7 +1359,7 @@ Foo: fn test_expand_usages_positional() { let usages = HashSet::from(["foo (a | c )".to_owned()]); - let result = expand_usages(usages, 2, &vec![]); + let result = expand_usages(usages, 2, &[]); assert_eq!( result, HashSet::from(["foo a ".to_owned(), "foo c ".to_owned(),]) @@ -1373,7 +1373,7 @@ Foo: .to_owned(), ]); - let result = expand_usages(usages, 3, &vec!["--sorted", "--quiet"]); + let result = expand_usages(usages, 3, &["--sorted", "--quiet"]); assert_eq!( result, HashSet::from([