Server overhaul: clear clippy::pedantic wins
Taken from a -W clippy::pedantic scan, no allow added: map_or/map_or_else, method references instead of closures, clone_from, write! instead of push_str(format!), borrowed Option<&str>, push_of without a needless Option, the envelope's entity moved instead of cloned, the scheduler's plan() no longer a needless async fn (its doc now says what it does on failure), sort_unstable, digit separators and inline format args in tests. Not taken: missing # Errors/# Panics docs, must_use, doc backticks, assert!(x.is_empty()) in tests, too_many_lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
@@ -44,7 +44,7 @@ async fn generation_writes_recurring_audit_with_server_now_and_no_device() {
|
||||
assert_eq!((a.client_at.as_str(), a.server_at.as_str()), (NOW, NOW));
|
||||
assert_eq!(
|
||||
a.changes[3],
|
||||
json!({"field": "amount_ore", "old": null, "new": 1250000})
|
||||
json!({"field": "amount_ore", "old": null, "new": 1_250_000})
|
||||
);
|
||||
// The entry reaches the phones through pull.
|
||||
let page = pull(&app, &admin_token(), 0, None).await.json;
|
||||
|
||||
@@ -28,7 +28,7 @@ fn versions(page: &Value) -> Vec<i64> {
|
||||
.map(|r| r["server_version"].as_i64().unwrap())
|
||||
})
|
||||
.collect();
|
||||
all.sort();
|
||||
all.sort_unstable();
|
||||
all
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ async fn the_first_page_has_everything_in_version_order_with_the_epoch_and_serve
|
||||
.map(|r| r["server_version"].as_i64().unwrap())
|
||||
.collect();
|
||||
let mut sorted = v.clone();
|
||||
sorted.sort();
|
||||
sorted.sort_unstable();
|
||||
assert_eq!(v, sorted, "{a} sorted by server_version");
|
||||
}
|
||||
// Children come with the parent.
|
||||
|
||||
Reference in New Issue
Block a user