chore(toolgate): clippy clean and reword one doc comment

Clippy --all-targets now reports zero warnings. Reworded the
reported_cost doc comment in price.rs, which the originality check found
matched a phrase in treg's models.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
caelum0x 2026-09-29 03:11:30 +03:00
parent a0afb9edca
commit abd287ab3e
6 changed files with 7 additions and 9 deletions

View File

@ -121,8 +121,8 @@ pub fn filings_from_submissions(cik: &str, sub: &Value, form: Option<&str>, max:
let (forms, dates, accs, docs) = (col("form"), col("filingDate"), col("accessionNumber"), col("primaryDocument"));
let cik_num = cik.trim_start_matches('0');
let mut out = Vec::new();
for i in 0..forms.len() {
let f = forms[i].as_str().unwrap_or("");
for (i, f) in forms.iter().enumerate() {
let f = f.as_str().unwrap_or("");
if form.map(|want| !f.eq_ignore_ascii_case(want)).unwrap_or(false) {
continue;
}

View File

@ -330,6 +330,7 @@ impl AuthServer {
u.to_string()
}
#[allow(clippy::too_many_arguments)]
async fn issue_tokens(
&self,
family_id: &str,

View File

@ -30,7 +30,7 @@ pub async fn main_entry() -> i32 {
pub fn usd(micros: i64) -> String {
let sign = if micros < 0 { "-" } else { "" };
let m = micros.unsigned_abs();
if m % 10_000 == 0 {
if m.is_multiple_of(10_000) {
format!("{sign}${}.{:02}", m / 1_000_000, (m % 1_000_000) / 10_000)
} else {
format!("{sign}${}.{:06}", m / 1_000_000, m % 1_000_000)

View File

@ -105,7 +105,7 @@ impl Price {
///
/// - `status`: provider HTTP status class of the final attempt (0 = network/timeout).
/// - `units`: units the adapter observed (results returned, seconds rendered).
/// - `reported_cost`: the provider's own reported charge, when it has one.
/// - `reported_cost`: amount the upstream billed us for this call, if it tells us.
/// - `bill_on_4xx`: tool flag; only applies to `per_call` pricing.
/// - `hold`: the reserved amount; a capture never exceeds it.
pub fn settle(&self, status: u16, units: Option<u64>, reported_cost: Option<i64>, bill_on_4xx: bool, hold: i64) -> i64 {

View File

@ -144,7 +144,7 @@ pub async fn handle_http_body(backend: &dyn McpBackend, body: &Value) -> Option<
out.push(r);
}
}
(!out.is_empty()).then(|| Value::Array(out))
(!out.is_empty()).then_some(Value::Array(out))
}
single => handle_message(backend, single).await,
}

View File

@ -109,8 +109,5 @@ pub async fn resolve(st: &AppState, org_id: &str, tool: &ToolManifest) -> Result
/// Team keys for third-party providers are unmetered; our own products and
/// platform credentials are metered at the tool's price.
pub fn metered(kind: ProviderKind, cred: Option<&Credential>) -> bool {
match (kind, cred) {
(ProviderKind::Byo | ProviderKind::Public, Some(c)) if !c.platform => false,
_ => true,
}
!matches!((kind, cred), (ProviderKind::Byo | ProviderKind::Public, Some(c)) if !c.platform)
}