diff --git a/compiler/src/function/result/result.rs b/compiler/src/function/result/result.rs index 3f4a7d9b5b..29ace00aed 100644 --- a/compiler/src/function/result/result.rs +++ b/compiler/src/function/result/result.rs @@ -44,7 +44,7 @@ impl> ConstrainedProgram { // If all indicators are none, then there are no branch conditions in the function. // We simply return the last result. - if let None = results.iter().find(|(indicator, _res)| indicator.is_some()) { + if results.iter().all(|(indicator, _res)| indicator.is_none()) { let result = &results[results.len() - 1].1; *return_value = result.clone(); diff --git a/leo/config.rs b/leo/config.rs index 4a0d2a76d6..8f24b359e1 100644 --- a/leo/config.rs +++ b/leo/config.rs @@ -91,7 +91,7 @@ impl Config { let toml_string = match fs::read_to_string(&config_path) { Ok(mut toml) => { // If the config is using an incorrect format, rewrite it. - if let Err(_) = toml::from_str::(&toml) { + if toml::from_str::(&toml).is_err() { let default_config_string = toml::to_string(&Config::default())?; fs::write(&config_path, default_config_string.clone())?; toml = default_config_string;