clippy: fix redundant_pattern_matching

Signed-off-by: ljedrz <ljedrz@gmail.com>
This commit is contained in:
ljedrz 2020-10-06 12:30:11 +02:00
parent 4d8a91418f
commit 08afb0e604
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ impl<F: Field + PrimeField, G: GroupType<F>> ConstrainedProgram<F, G> {
// 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();

View File

@ -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::<Config>(&toml) {
if toml::from_str::<Config>(&toml).is_err() {
let default_config_string = toml::to_string(&Config::default())?;
fs::write(&config_path, default_config_string.clone())?;
toml = default_config_string;