Fix Clippy warnings blocking release checks
Some checks failed
Validate authentication / Validate authentication (push) Failing after 1s

This commit is contained in:
Alois 2026-10-04 21:14:35 +02:00
commit 976ffde7a8
Signed by: alois
SSH key fingerprint: SHA256:GBzT2DXvAuGV9XIV5W3WrzVpjU54FThmxHXdbz95J24
42 changed files with 315 additions and 346 deletions

View file

@ -127,16 +127,13 @@ pub struct RelayRouterSettings {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Default)]
pub enum WebMode {
#[default]
Disabled,
Loopback,
Network,
}
impl Default for WebMode {
fn default() -> Self {
Self::Disabled
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
@ -340,14 +337,14 @@ pub fn save_config() {
pub fn save_config_to(path: &Path) {
if let Ok(yaml) = serde_yaml::to_string(&**CONFIG.load()) {
if let Some(parent) = path.parent() {
if let Err(error) = fs::create_dir_all(parent) {
eprintln!(
"Cannot create configuration directory {}: {error}",
parent.display()
);
return;
}
if let Some(parent) = path.parent()
&& let Err(error) = fs::create_dir_all(parent)
{
eprintln!(
"Cannot create configuration directory {}: {error}",
parent.display()
);
return;
}
if let Err(error) = iota_util::atomic_file::replace(path, yaml.as_bytes(), 3) {
eprintln!("Cannot save {}: {error}", path.display());
@ -495,8 +492,10 @@ mod tests {
#[test]
fn zero_ipc_capacity_is_rejected() {
let mut config = IotaConfig::default();
config.max_ipc_clients = 0;
let config = IotaConfig {
max_ipc_clients: 0,
..IotaConfig::default()
};
assert!(matches!(
validate_config(&config),
Err(ConfigError::InvalidMaxIpcClients)