From e0d0df4ab59ec7a4e749f18cf728cd7e8171b635 Mon Sep 17 00:00:00 2001 From: acheron <98934430+acheroncrypto@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:48:01 +0200 Subject: [PATCH] Fix 1.73.0 clippy warnings (#2674) --- cli/src/lib.rs | 2 +- lang/syn/src/idl/parse/file.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 4fdf34b0ad..0eac314736 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -942,7 +942,7 @@ fn new( std::env::set_current_dir(parent)?; let cluster = cfg.provider.cluster.clone(); - let programs = cfg.programs.entry(cluster).or_insert(BTreeMap::new()); + let programs = cfg.programs.entry(cluster).or_default(); if programs.contains_key(&name) { return Err(anyhow!("Program already exists")); } diff --git a/lang/syn/src/idl/parse/file.rs b/lang/syn/src/idl/parse/file.rs index 8d8d4c1296..a2a9dd7140 100644 --- a/lang/syn/src/idl/parse/file.rs +++ b/lang/syn/src/idl/parse/file.rs @@ -137,7 +137,7 @@ pub fn parse( .map(|a| a.ident.to_string()) .collect::>(); - let error_name = error.map(|e| e.name).unwrap_or_else(|| "".to_string()); + let error_name = error.map(|e| e.name).unwrap_or_default(); // All types that aren't in the accounts section, are in the types section. for ty_def in ty_defs {