chore: fix clippy lints to green the lint CI
- import.rs / promotion.rs: sort_by(|a,b| b.k.cmp(&a.k)) -> sort_by_key(Reverse(k)) - pipeline.rs: skip_while(!p).next() -> find(p) Behaviour-preserving; completes the CI fix started by the cargo fmt commit.
This commit is contained in:
+1
-1
@@ -184,7 +184,7 @@ impl JobStore {
|
|||||||
}
|
}
|
||||||
pub fn list(&self) -> Vec<Job> {
|
pub fn list(&self) -> Vec<Job> {
|
||||||
let mut v: Vec<Job> = self.jobs.lock().unwrap().values().cloned().collect();
|
let mut v: Vec<Job> = self.jobs.lock().unwrap().values().cloned().collect();
|
||||||
v.sort_by(|a, b| b.started.cmp(&a.started));
|
v.sort_by_key(|x| std::cmp::Reverse(x.started));
|
||||||
v.truncate(20);
|
v.truncate(20);
|
||||||
v
|
v
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -730,7 +730,7 @@ fn parse_judge(text: &str) -> (u8, bool) {
|
|||||||
let score = text
|
let score = text
|
||||||
.split("score")
|
.split("score")
|
||||||
.nth(1)
|
.nth(1)
|
||||||
.and_then(|t| t.chars().skip_while(|c| !c.is_ascii_digit()).next())
|
.and_then(|t| t.chars().find(|c| c.is_ascii_digit()))
|
||||||
.and_then(|c| c.to_digit(10))
|
.and_then(|c| c.to_digit(10))
|
||||||
.map(|d| d.min(4) as u8);
|
.map(|d| d.min(4) as u8);
|
||||||
let hard_fail = text
|
let hard_fail = text
|
||||||
|
|||||||
+1
-1
@@ -272,7 +272,7 @@ impl Promotion {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
out.sort_by(|a, b| b.2.cmp(&a.2));
|
out.sort_by_key(|x| std::cmp::Reverse(x.2));
|
||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user