-
Notifications
You must be signed in to change notification settings - Fork 4
clippy lints #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
clippy lints #75
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -27,6 +27,7 @@ const BUF_COUNT: usize = 10; | |||
| * assessed against the actual file size and a partial (206) response will be | ||||
| * returned, for both GET and HEAD. | ||||
| */ | ||||
| #[allow(clippy::too_many_arguments)] | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I would rather not put these annotations throughout, especially for the more editorial style things like this. |
||||
| pub async fn stream_from_url( | ||||
| log: &Logger, | ||||
| info: String, | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -624,7 +624,7 @@ impl HostManager { | |
| Ok(()) | ||
| } | ||
| HostState::Cleaning(cst) => { | ||
| let mut new_cst = cst.clone(); | ||
| let mut new_cst = *cst; | ||
|
|
||
| { | ||
| let mut l = self.locked.lock().unwrap(); | ||
|
|
@@ -700,7 +700,7 @@ impl HostManager { | |
| Ok(()) | ||
| } | ||
| HostState::Starting(sst, hgs) => { | ||
| let mut new_sst = sst.clone(); | ||
| let mut new_sst = *sst; | ||
|
|
||
| { | ||
| let mut l = self.locked.lock().unwrap(); | ||
|
|
@@ -726,7 +726,7 @@ impl HostManager { | |
| } | ||
| } | ||
|
|
||
| if let Err(e) = self.thread_starting(&mut new_sst, &hgs) { | ||
| if let Err(e) = self.thread_starting(&mut new_sst, hgs) { | ||
| error!(log, "starting error: {e}"); | ||
| } | ||
|
|
||
|
|
@@ -794,7 +794,7 @@ impl HostManager { | |
|
|
||
| let pb = sys | ||
| .ssh_exec("svcs -Ho sta,nsta svc:/site/postboot:default")?; | ||
| let t = pb.out.trim().split_whitespace().collect::<Vec<_>>(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, that is absolutely not how I expect split_whitespace() to work! The fact that it ignores leading and trailing whitespace (and thus potentially misses empty columns!) is ... a choice. |
||
| let t = pb.out.split_whitespace().collect::<Vec<_>>(); | ||
| if t.len() != 2 || t[0] == "ON" || t[1] == "-" { | ||
| bail!("postboot not ready: {t:?}"); | ||
| } | ||
|
|
@@ -847,7 +847,7 @@ impl HostManager { | |
|
|
||
| let pb = sys | ||
| .ssh_exec("svcs -Ho sta,nsta svc:/site/postboot:default")?; | ||
| let t = pb.out.trim().split_whitespace().collect::<Vec<_>>(); | ||
| let t = pb.out.split_whitespace().collect::<Vec<_>>(); | ||
| if t.len() != 2 || t[0] == "ON" || t[1] == "-" { | ||
| bail!("postboot not ready: {t:?}"); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -17,6 +17,7 @@ use slog::{info, warn, Logger}; | |||
| use crate::pipe::*; | ||||
| use buildomat_common::OutputExt; | ||||
|
|
||||
| #[allow(clippy::wrong_self_convention)] | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I would rather just ignore the editorial ones. I don't plan to have strict clippy cleanness block integration, etc. |
||||
| pub trait ValueExt { | ||||
| fn is_unit(&self) -> bool; | ||||
| fn from_hex(&self) -> Result<u64>; | ||||
|
|
@@ -57,7 +58,7 @@ impl ValueExt for Value { | |||
| bail!("expected a hex number, got {t:?}"); | ||||
| }; | ||||
|
|
||||
| out.push(u8::from_str_radix(&hex, 16)?); | ||||
| out.push(u8::from_str_radix(hex, 16)?); | ||||
| } | ||||
| _ => bail!("list should only contain terms"), | ||||
| } | ||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.