Fix Clippy warnings blocking release checks
Some checks failed
Validate authentication / Validate authentication (push) Failing after 1s
Some checks failed
Validate authentication / Validate authentication (push) Failing after 1s
This commit is contained in:
parent
e71d9c3118
commit
976ffde7a8
42 changed files with 315 additions and 346 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue