lint: fix clippy absolute_paths & disallowed_methods after merge

- Import serde:🇩🇪:Error trait so the `custom` fn pointer uses `D::Error`
  instead of the absolute `serde:🇩🇪:Error::custom` path.
- Import `fabro_api::types::ServerSettings` / `fabro_config::UserSettings`
  directly rather than through absolute paths.
- Gate sync `std::fs::write` fixture setup in new config resolver tests
  with a file-level `#![expect(clippy::disallowed_methods, …)]`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-04-22 21:48:20 -04:00
parent fa62da5d9d
commit 2ddbe49cb8
No known key found for this signature in database
5 changed files with 18 additions and 7 deletions

View file

@ -9,6 +9,8 @@
use std::io::Write;
use fabro_api::types::ServerSettings;
use fabro_config::UserSettings;
use fabro_types::settings::CliNamespace;
use fabro_types::settings::cli::{CliLayer, OutputFormat};
use fabro_util::printer::Printer;
@ -20,8 +22,8 @@ use crate::shared::print_json_pretty;
#[derive(Serialize)]
struct RenderedConfig {
user: fabro_config::UserSettings,
server: fabro_api::types::ServerSettings,
user: UserSettings,
server: ServerSettings,
}
async fn rendered_config(

View file

@ -490,16 +490,14 @@ impl Client {
}
}
pub async fn retrieve_resolved_server_settings(
&self,
) -> Result<fabro_api::types::ServerSettings> {
pub async fn retrieve_resolved_server_settings(&self) -> Result<types::ServerSettings> {
let url = format!("{}/api/v1/settings", self.base_url());
let response = self
.send_http(|http_client| async move { http_client.get(&url).send().await })
.await?;
response
.json::<fabro_api::types::ServerSettings>()
.json::<types::ServerSettings>()
.await
.context("server returned invalid JSON for server settings")
}

View file

@ -1,3 +1,8 @@
#![expect(
clippy::disallowed_methods,
reason = "sync test fixture setup; not on a Tokio path"
)]
use fabro_config::{parse_settings_layer, resolve_cli_from_file};
use fabro_types::settings::cli::{CliTargetSettings, OutputFormat, OutputVerbosity};
use fabro_types::settings::run::AgentPermissions;

View file

@ -1,3 +1,8 @@
#![expect(
clippy::disallowed_methods,
reason = "sync test fixture setup; not on a Tokio path"
)]
use fabro_config::parse_settings_layer;
use fabro_config::user::default_storage_dir;
use fabro_types::settings::server::{

View file

@ -10,6 +10,7 @@ use std::net::SocketAddr;
use std::time::Duration as StdDuration;
use ipnet::IpNet;
use serde::de::Error as _;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use super::duration::Duration as DurationLayer;
@ -287,7 +288,7 @@ where
D: Deserializer<'de>,
{
let value = String::deserialize(deserializer)?;
value.parse().map_err(serde::de::Error::custom)
value.parse().map_err(D::Error::custom)
}
fn serialize_std_duration<S>(value: &StdDuration, serializer: S) -> Result<S::Ok, S::Error>