mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-15 23:32:46 +00:00
fix(clippy): restore workspace lint cleanups after main merge
Reapply the lint-safe changes that were partially displaced while merging origin/main, including the billing serialization assertion and the attach replay/server annotation cleanups. This keeps the merged main branch back to a clean full-workspace clippy pass before the store-dump debugging continues.
This commit is contained in:
parent
b6e5ac4f38
commit
668d7857e6
5 changed files with 15 additions and 7 deletions
|
|
@ -5,10 +5,10 @@ pub(crate) use fabro_config::user::*;
|
|||
use anyhow::{Result, bail};
|
||||
use fabro_config::ConfigLayer;
|
||||
use fabro_types::Settings;
|
||||
use fabro_util::version::FABRO_VERSION;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::args::ServerTargetArgs;
|
||||
use fabro_util::version::FABRO_VERSION;
|
||||
|
||||
pub(crate) fn load_settings() -> anyhow::Result<Settings> {
|
||||
load_settings_with_config_and_storage_dir(None, None)
|
||||
|
|
|
|||
|
|
@ -162,8 +162,8 @@ struct ApiResponse {
|
|||
usage: ApiUsage,
|
||||
}
|
||||
|
||||
#[allow(clippy::struct_field_names)]
|
||||
#[derive(serde::Deserialize)]
|
||||
#[allow(clippy::struct_field_names)] // Match Anthropic's API usage payload field names.
|
||||
struct ApiUsage {
|
||||
input_tokens: i64,
|
||||
output_tokens: i64,
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ pub struct ModelPricing {
|
|||
pub policy: ModelPricingPolicy,
|
||||
}
|
||||
|
||||
#[allow(clippy::empty_structs_with_brackets)]
|
||||
#[allow(clippy::empty_structs_with_brackets)] // Serialize as `{}` rather than unit-struct `null`.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
|
||||
pub struct OpenAiBillingFacts {}
|
||||
|
||||
|
|
@ -735,4 +735,12 @@ mod tests {
|
|||
|
||||
assert_eq!(price.usd_micros, i64::MAX);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn openai_billing_facts_serialize_as_empty_object() {
|
||||
assert_eq!(
|
||||
serde_json::to_value(OpenAiBillingFacts::default()).unwrap(),
|
||||
serde_json::json!({})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ async fn wait_for_shutdown(mut shutdown_rx: watch::Receiver<bool>) {
|
|||
let _ = shutdown_rx.changed().await;
|
||||
}
|
||||
|
||||
#[allow(clippy::print_stderr)]
|
||||
#[allow(clippy::print_stderr)] // Startup status belongs on stderr for operator-facing CLI output.
|
||||
fn announce_server_ready(bind_addr: &Bind, styles: &'static Styles, dry_run_mode: bool) {
|
||||
set_server_title(ServerTitlePhase::Listening, Some(bind_addr));
|
||||
info!(bind = %bind_addr, dry_run = dry_run_mode, "API server started");
|
||||
|
|
|
|||
|
|
@ -110,8 +110,6 @@ pub fn default_page_limit() -> u32 {
|
|||
20
|
||||
}
|
||||
|
||||
const ATTACH_REPLAY_BATCH_LIMIT: usize = 256;
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct PaginationParams {
|
||||
#[serde(rename = "page[limit]", default = "default_page_limit")]
|
||||
|
|
@ -2559,7 +2557,7 @@ fn api_question_from_interview_question(id: &str, question: &Question) -> ApiQue
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::result_large_err)]
|
||||
#[allow(clippy::result_large_err)] // Axum handlers naturally propagate full `Response` errors.
|
||||
fn answer_from_request(req: SubmitAnswerRequest, question: &Question) -> Result<Answer, Response> {
|
||||
if let Some(key) = req.selected_option_key {
|
||||
let option = question
|
||||
|
|
@ -3645,6 +3643,8 @@ async fn attach_run_events(
|
|||
Path(id): Path<String>,
|
||||
Query(params): Query<AttachParams>,
|
||||
) -> Response {
|
||||
const ATTACH_REPLAY_BATCH_LIMIT: usize = 256;
|
||||
|
||||
let id = match parse_run_id_path(&id) {
|
||||
Ok(id) => id,
|
||||
Err(response) => return response,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue