From e5faca7c5a2e9d0ffa4a491edcded60ee0254a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sun, 12 Nov 2023 15:23:47 +0100 Subject: [PATCH] Removing useless mutables --- acmed/src/account.rs | 10 +++++----- acmed/src/config.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/acmed/src/account.rs b/acmed/src/account.rs index a8f3f29..0c07946 100644 --- a/acmed/src/account.rs +++ b/acmed/src/account.rs @@ -242,27 +242,27 @@ impl Account { } pub fn set_account_url(&mut self, endpoint_name: &str, account_url: &str) -> Result<(), Error> { - let mut ep = self.get_endpoint_mut(endpoint_name)?; + let ep = self.get_endpoint_mut(endpoint_name)?; ep.account_url = account_url.to_string(); Ok(()) } pub fn set_orders_url(&mut self, endpoint_name: &str, orders_url: &str) -> Result<(), Error> { - let mut ep = self.get_endpoint_mut(endpoint_name)?; + let ep = self.get_endpoint_mut(endpoint_name)?; ep.orders_url = orders_url.to_string(); Ok(()) } pub fn update_key_hash(&mut self, endpoint_name: &str) -> Result<(), Error> { let key = self.current_key.clone(); - let mut ep = self.get_endpoint_mut(endpoint_name)?; + let ep = self.get_endpoint_mut(endpoint_name)?; ep.key_hash = hash_key(&key)?; Ok(()) } pub fn update_contacts_hash(&mut self, endpoint_name: &str) -> Result<(), Error> { let ct = self.contacts.clone(); - let mut ep = self.get_endpoint_mut(endpoint_name)?; + let ep = self.get_endpoint_mut(endpoint_name)?; ep.contacts_hash = hash_contacts(&ct); Ok(()) } @@ -270,7 +270,7 @@ impl Account { pub fn update_external_account_hash(&mut self, endpoint_name: &str) -> Result<(), Error> { if let Some(ec) = &self.external_account { let ec = ec.clone(); - let mut ep = self.get_endpoint_mut(endpoint_name)?; + let ep = self.get_endpoint_mut(endpoint_name)?; ep.external_account_hash = hash_external_account(&ec); } Ok(()) diff --git a/acmed/src/config.rs b/acmed/src/config.rs index 032654d..9ef437f 100644 --- a/acmed/src/config.rs +++ b/acmed/src/config.rs @@ -760,7 +760,7 @@ fn read_cnf(path: &Path, loaded_files: &mut BTreeSet) -> Result