mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-24 07:48:04 +03:00
clippy: fix redundant_pattern_matching
Signed-off-by: ljedrz <ljedrz@gmail.com>
This commit is contained in:
parent
4d8a91418f
commit
08afb0e604
@ -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.
|
// If all indicators are none, then there are no branch conditions in the function.
|
||||||
// We simply return the last result.
|
// 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;
|
let result = &results[results.len() - 1].1;
|
||||||
|
|
||||||
*return_value = result.clone();
|
*return_value = result.clone();
|
||||||
|
@ -91,7 +91,7 @@ impl Config {
|
|||||||
let toml_string = match fs::read_to_string(&config_path) {
|
let toml_string = match fs::read_to_string(&config_path) {
|
||||||
Ok(mut toml) => {
|
Ok(mut toml) => {
|
||||||
// If the config is using an incorrect format, rewrite it.
|
// 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())?;
|
let default_config_string = toml::to_string(&Config::default())?;
|
||||||
fs::write(&config_path, default_config_string.clone())?;
|
fs::write(&config_path, default_config_string.clone())?;
|
||||||
toml = default_config_string;
|
toml = default_config_string;
|
||||||
|
Loading…
Reference in New Issue
Block a user