boulder: Add '--build', '--mv-to-repo=', and '--re-index' flags #570
Annotations
2 errors and 10 warnings
Run clippy
reviewdog exited with status code: 1
|
Run clippy
reviewdog: Too many results (annotations) in diff.
You may miss some annotations due to GitHub limitation for annotation created by logging command.
Please check GitHub Actions log console to see all results.
Limitation:
- 10 warning annotations and 10 error annotations per step
- 50 annotations per job (sum of annotations from all the steps)
- 50 annotations per run (separate from the job annotations, these annotations aren't created by users)
Source: https://github.com/orgs/community/discussions/26680#discussioncomment-3252835
|
Run clippy:
boulder/src/cli.rs#L187
[clippy] reported by reviewdog 🐶
warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
--> boulder/src/cli.rs:187:47
|
187 | ... let uri = line
| _________________________________^
188 | | ... .split_whitespace()
189 | | ... .filter(|line| line.contains("//"))
190 | | ... .last()
| |____________________________-----^
| |
| help: try: `next_back()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last
Raw Output:
boulder/src/cli.rs:187:47:w:warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
--> boulder/src/cli.rs:187:47
|
187 | ... let uri = line
| _________________________________^
188 | | ... .split_whitespace()
189 | | ... .filter(|line| line.contains("//"))
190 | | ... .last()
| |____________________________-----^
| |
| help: try: `next_back()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last
__END__
|
Run clippy:
boulder/src/cli.rs#L187
[clippy] reported by reviewdog 🐶
warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
--> boulder/src/cli.rs:187:47
|
187 | ... let uri = line
| _________________________________^
188 | | ... .split_whitespace()
189 | | ... .filter(|line| line.contains("//"))
190 | | ... .last()
... |
197 | | ... })
| |____________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
= note: `#[warn(clippy::bind_instead_of_map)]` on by default
help: use `map` instead
|
191 ~ .map(|uri| {
192 | if uri.contains("file:///") {
193 ~ uri.to_string().replace("file://", "")
194 | } else {
195 ~ uri.to_string()
|
Raw Output:
boulder/src/cli.rs:187:47:w:warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
--> boulder/src/cli.rs:187:47
|
187 | ... let uri = line
| _________________________________^
188 | | ... .split_whitespace()
189 | | ... .filter(|line| line.contains("//"))
190 | | ... .last()
... |
197 | | ... })
| |____________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
= note: `#[warn(clippy::bind_instead_of_map)]` on by default
help: use `map` instead
|
191 ~ .map(|uri| {
192 | if uri.contains("file:///") {
193 ~ uri.to_string().replace("file://", "")
194 | } else {
195 ~ uri.to_string()
|
__END__
|
Run clippy:
boulder/src/cli.rs#L198
[clippy] reported by reviewdog 🐶
warning: function call inside of `expect`
--> boulder/src/cli.rs:198:42
|
198 | ... .expect("Couldn't get URI from repo string".red().to_string().as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("{}", "Couldn't get URI from repo string".red().to_string()))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
Raw Output:
boulder/src/cli.rs:198:42:w:warning: function call inside of `expect`
--> boulder/src/cli.rs:198:42
|
198 | ... .expect("Couldn't get URI from repo string".red().to_string().as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("{}", "Couldn't get URI from repo string".red().to_string()))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
__END__
|
Run clippy:
boulder/src/cli.rs#L182
[clippy] reported by reviewdog 🐶
warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
--> boulder/src/cli.rs:182:39
|
182 | let mv_repo = repos
| _______________________________________^
183 | | .lines()
184 | | .filter_map(|line| {
185 | | if line.contains(&repo) {
... |
206 | | })
207 | | .last()
| |______________________________-----^
| |
| help: try: `next_back()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last
= note: `#[warn(clippy::double_ended_iterator_last)]` on by default
Raw Output:
boulder/src/cli.rs:182:39:w:warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
--> boulder/src/cli.rs:182:39
|
182 | let mv_repo = repos
| _______________________________________^
183 | | .lines()
184 | | .filter_map(|line| {
185 | | if line.contains(&repo) {
... |
206 | | })
207 | | .last()
| |______________________________-----^
| |
| help: try: `next_back()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last
= note: `#[warn(clippy::double_ended_iterator_last)]` on by default
__END__
|
Run clippy:
boulder/src/cli.rs#L208
[clippy] reported by reviewdog 🐶
warning: redundant closure
--> boulder/src/cli.rs:208:45
|
208 | ... .unwrap_or_else(|| HashMap::new());
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `HashMap::new`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
Raw Output:
boulder/src/cli.rs:208:45:w:warning: redundant closure
--> boulder/src/cli.rs:208:45
|
208 | ... .unwrap_or_else(|| HashMap::new());
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `HashMap::new`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
__END__
|
Run clippy:
boulder/src/cli.rs#L220
[clippy] reported by reviewdog 🐶
warning: called `expect` on `repo` after checking its variant with `is_some`
--> boulder/src/cli.rs:221:70
|
220 | ... if global.re_index && repo.is_some() {
| -------------- the check is happening here
221 | ... if let Err(err) = re_index_repo(&repo.expect("Repo was supposed to be Some")) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try using `if let` or `match`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default
Raw Output:
boulder/src/cli.rs:220:55:w:warning: called `expect` on `repo` after checking its variant with `is_some`
--> boulder/src/cli.rs:221:70
|
220 | ... if global.re_index && repo.is_some() {
| -------------- the check is happening here
221 | ... if let Err(err) = re_index_repo(&repo.expect("Repo was supposed to be Some")) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try using `if let` or `match`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default
__END__
|
Run clippy:
boulder/src/cli/recipe.rs#L143
[clippy] reported by reviewdog 🐶
warning: function call inside of `expect`
--> boulder/src/cli/recipe.rs:143:14
|
143 | .expect(&format!("{}", "boulder build command failed to wait to complete".red()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("{}", "boulder build command failed to wait to complete".red()))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
= note: `#[warn(clippy::expect_fun_call)]` on by default
Raw Output:
boulder/src/cli/recipe.rs:143:14:w:warning: function call inside of `expect`
--> boulder/src/cli/recipe.rs:143:14
|
143 | .expect(&format!("{}", "boulder build command failed to wait to complete".red()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("{}", "boulder build command failed to wait to complete".red()))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
= note: `#[warn(clippy::expect_fun_call)]` on by default
__END__
|
Run clippy:
boulder/src/draft/upstream.rs#L102
[clippy] reported by reviewdog 🐶
warning: all if blocks contain the same code at the end
--> boulder/src/draft/upstream.rs:102:5
|
102 | / let result = Command::new("bsdtar")
103 | | .arg("xf")
104 | | .arg(archive)
105 | | .arg("-C")
... |
115 | | }
| |_____^
|
= note: the end suggestion probably needs some adjustments to use the expression result correctly
= warning: some moved values might need to be renamed to avoid wrong references
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
= note: requested on the command line with `-W clippy::branches-sharing-code`
help: consider moving these statements after the if
|
102 ~ }
103 + let result = Command::new("bsdtar")
104 + .arg("xf")
105 + .arg(archive)
106 + .arg("-C")
107 + .arg(destination)
108 + .output()
109 + .await?;
110 + if result.status.success() {
111 + Ok(())
112 + } else {
113 + eprintln!("Command exited with: {}", String::from_utf8_lossy(&result.stderr));
114 + Err(Error::Extract(result.status))
115 + }
|
Raw Output:
boulder/src/draft/upstream.rs:102:5:w:warning: all if blocks contain the same code at the end
--> boulder/src/draft/upstream.rs:102:5
|
102 | / let result = Command::new("bsdtar")
103 | | .arg("xf")
104 | | .arg(archive)
105 | | .arg("-C")
... |
115 | | }
| |_____^
|
= note: the end suggestion probably needs some adjustments to use the expression result correctly
= warning: some moved values might need to be renamed to avoid wrong references
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
= note: requested on the command line with `-W clippy::branches-sharing-code`
help: consider moving these statements after the if
|
102 ~ }
103 + let result = Command::new("bsdtar")
104 + .arg("xf")
105 + .arg(archive)
106 + .arg("-C")
107 + .arg(destination)
108 + .output()
109 + .await?;
110 + if result.status.success() {
111 + Ok(())
112 + } else {
113 + eprintln!("Command exited with: {}", String::from_utf8_lossy(&result.stderr));
114 + Err(Error::Extract(result.status))
115 + }
|
__END__
|
Run clippy:
boulder/src/build.rs#L334
[clippy] reported by reviewdog 🐶
warning: this method chain can be written more clearly with `if .. else ..`
--> boulder/src/build.rs:334:19
|
334 | let pgo = is_pgo.then_some("│").unwrap_or_default().dim();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if is_pgo { "│" } else { Default::default() }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#obfuscated_if_else
= note: `#[warn(clippy::obfuscated_if_else)]` on by default
Raw Output:
boulder/src/build.rs:334:19:w:warning: this method chain can be written more clearly with `if .. else ..`
--> boulder/src/build.rs:334:19
|
334 | let pgo = is_pgo.then_some("│").unwrap_or_default().dim();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if is_pgo { "│" } else { Default::default() }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#obfuscated_if_else
= note: `#[warn(clippy::obfuscated_if_else)]` on by default
__END__
|
Run clippy:
crates/stone/src/write.rs#L307
[clippy] reported by reviewdog 🐶
warning: this method chain can be written more clearly with `if .. else ..`
--> crates/stone/src/write.rs:307:47
|
307 | num_payloads: payloads.len() as u16 + content.is_some().then_some(1).unwrap_or_default(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if content.is_some() { 1 } else { Default::default() }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#obfuscated_if_else
= note: `#[warn(clippy::obfuscated_if_else)]` on by default
Raw Output:
crates/stone/src/write.rs:307:47:w:warning: this method chain can be written more clearly with `if .. else ..`
--> crates/stone/src/write.rs:307:47
|
307 | num_payloads: payloads.len() as u16 + content.is_some().then_some(1).unwrap_or_default(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if content.is_some() { 1 } else { Default::default() }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#obfuscated_if_else
= note: `#[warn(clippy::obfuscated_if_else)]` on by default
__END__
|
Loading