clippy: zero pedantic warnings across the tree
This commit is contained in:
parent
690cb5ab5b
commit
f9f1346eae
20 changed files with 71 additions and 61 deletions
|
|
@ -234,7 +234,7 @@ impl TokenUsage {
|
|||
if v.get("type").and_then(|t| t.as_str()) != Some("result") {
|
||||
return None;
|
||||
}
|
||||
Self::from_usage_obj(v.get("usage")?)
|
||||
Some(Self::from_usage_obj(v.get("usage")?))
|
||||
}
|
||||
|
||||
/// Parse usage from a per-inference `assistant` event's
|
||||
|
|
@ -245,17 +245,17 @@ impl TokenUsage {
|
|||
if v.get("type").and_then(|t| t.as_str()) != Some("assistant") {
|
||||
return None;
|
||||
}
|
||||
Self::from_usage_obj(v.get("message")?.get("usage")?)
|
||||
Some(Self::from_usage_obj(v.get("message")?.get("usage")?))
|
||||
}
|
||||
|
||||
fn from_usage_obj(u: &serde_json::Value) -> Option<Self> {
|
||||
fn from_usage_obj(u: &serde_json::Value) -> Self {
|
||||
let field = |k: &str| u.get(k).and_then(serde_json::Value::as_u64).unwrap_or(0);
|
||||
Some(Self {
|
||||
Self {
|
||||
input_tokens: field("input_tokens"),
|
||||
output_tokens: field("output_tokens"),
|
||||
cache_read_input_tokens: field("cache_read_input_tokens"),
|
||||
cache_creation_input_tokens: field("cache_creation_input_tokens"),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -494,7 +494,7 @@ impl Bus {
|
|||
});
|
||||
}
|
||||
|
||||
/// Broadcast a status flip (online / needs_login_*). Called by
|
||||
/// Broadcast a status flip (online / `needs_login_*`). Called by
|
||||
/// the bin entry points + `turn::wait_for_login` + the
|
||||
/// `post_login_*` handlers — every site that mutates the
|
||||
/// `Arc<Mutex<LoginState>>` should also call this so the web UI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue