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:
@@ -206,7 +206,7 @@ fn canon(value: &Value, names: bool) -> Value {
|
||||
Some(Value::Array(inner))
|
||||
if alternative.as_object().is_some_and(|o| o.len() == 1) =>
|
||||
{
|
||||
flat.extend(inner.iter().cloned())
|
||||
flat.extend(inner.iter().cloned());
|
||||
}
|
||||
_ => flat.push(alternative),
|
||||
}
|
||||
@@ -383,7 +383,7 @@ fn generated_document_equals_contract() {
|
||||
paths
|
||||
.values()
|
||||
.filter_map(Value::as_object)
|
||||
.map(|m| m.len())
|
||||
.map(serde_json::Map::len)
|
||||
.sum::<usize>()
|
||||
})
|
||||
.unwrap_or(0);
|
||||
|
||||
Reference in New Issue
Block a user