From 4397345669b70e8fcc2e93e090f9f49f4b18abba Mon Sep 17 00:00:00 2001 From: "Christopher L. Crutchfield" Date: Fri, 6 Dec 2024 20:10:44 -0800 Subject: [PATCH] chore: fix clippy errors --- src/credential_manager.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/credential_manager.rs b/src/credential_manager.rs index 01a15d9..9c2d541 100644 --- a/src/credential_manager.rs +++ b/src/credential_manager.rs @@ -145,7 +145,7 @@ impl CredentialManager { info!("Creating Credentials table in user database."); let conn = &self.connection; - let version = self.get_database_version(&conn); + let version = self.get_database_version(conn); match version { Ok(version) => { @@ -158,7 +158,7 @@ impl CredentialManager { ALTER TABLE Credentials ADD COLUMN device_id_nonce BLOB;", )?; - self.create_tables(&conn) + self.create_tables(conn) } 1 => { // Up to date. Do Nothing @@ -171,7 +171,7 @@ impl CredentialManager { Err(err) => match err { CredentialError::DatabaseNotInitialized => { - self.create_tables(&conn) + self.create_tables(conn) }, _ => Err(anyhow!(err)) } @@ -185,9 +185,10 @@ impl CredentialManager { info!("Selecting rows from sqlite_master table."); let mut stmt: rusqlite::Statement<'_> = connection.prepare( "SELECT name FROM sqlite_master WHERE type='table' AND name IN ('Credentials', 'Metadata');")?; - let rows = stmt.query_map([], |row| { - Ok(row.get(0)?) - })?.filter_map(|r| r.ok()).collect::>(); + let rows = stmt + .query_map([], |row| row.get(0))? + .filter_map(|r| r.ok()) + .collect::>(); if rows.is_empty() { return Err(CredentialError::DatabaseNotInitialized);