Skip to content

Commit

Permalink
Merge pull request #226 from hasnain-db/clippy
Browse files Browse the repository at this point in the history
Fix clippy warnings
  • Loading branch information
nicklan authored Jan 8, 2024
2 parents 9b8643d + d2e9aaf commit 058a2e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/config/kubefile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,11 @@ impl AuthProviderGcpConfig {
fn update_token(&self, token: &mut Option<String>, expiry: &mut Option<DateTime<Local>>) {
match self.cmd_path {
Some(ref conf_cmd) => {
let args = self
let args: Vec<_> = self
.cmd_args
.as_ref()
.map(|argstr| argstr.split_whitespace().collect())
.unwrap_or_else(Vec::new);
.unwrap_or_default();
match ductcmd(conf_cmd, &args).read() {
Ok(output) => {
self.parse_output_and_update(output.as_str(), token, expiry);
Expand Down
2 changes: 1 addition & 1 deletion src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl Env {
let range_str = if range.is_empty() {
"Empty range".to_string()
} else {
let mut r = format!("{} {}", range.len(), range.get(0).unwrap().type_str());
let mut r = format!("{} {}", range.len(), range.first().unwrap().type_str());
if range.len() > 1 {
r.push('s');
}
Expand Down
2 changes: 2 additions & 0 deletions src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ impl<'a> PartialEq for CellSpec<'a> {
}
impl<'a> Eq for CellSpec<'a> {}

// We ensure they are in sync (see impl for `Ord`), but clippy doesn't seem to recognize this.
#[allow(clippy::non_canonical_partial_ord_impl)]
impl<'a> PartialOrd for CellSpec<'a> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
match (&self.txt, &other.txt) {
Expand Down

0 comments on commit 058a2e0

Please sign in to comment.