diff --git a/plugins/authenticator/src/auth.rs b/plugins/authenticator/src/auth.rs index 363b0d11..3241ef72 100644 --- a/plugins/authenticator/src/auth.rs +++ b/plugins/authenticator/src/auth.rs @@ -75,8 +75,8 @@ pub fn register(application: String, timeout: u64, challenge: String) -> crate:: let (key_handle, public_key) = _u2f_get_key_handle_and_public_key_from_register_response(®ister_data).unwrap(); - let key_handle_base64 = encode_config(&key_handle, URL_SAFE_NO_PAD); - let public_key_base64 = encode_config(&public_key, URL_SAFE_NO_PAD); + let key_handle_base64 = encode_config(key_handle, URL_SAFE_NO_PAD); + let public_key_base64 = encode_config(public_key, URL_SAFE_NO_PAD); let register_data_base64 = encode_config(®ister_data, URL_SAFE_NO_PAD); println!("Key Handle: {}", &key_handle_base64); println!("Public Key: {}", &public_key_base64); @@ -108,7 +108,7 @@ pub fn sign( challenge: String, key_handle: String, ) -> crate::Result { - let credential = match decode_config(&key_handle, URL_SAFE_NO_PAD) { + let credential = match decode_config(key_handle, URL_SAFE_NO_PAD) { Ok(v) => v, Err(e) => { return Err(e.into()); @@ -152,7 +152,7 @@ pub fn sign( let (_, handle_used, sign_data, device_info) = sign_result.unwrap(); - let sig = encode_config(&sign_data, URL_SAFE_NO_PAD); + let sig = encode_config(sign_data, URL_SAFE_NO_PAD); println!("Sign result: {}", sig); println!( diff --git a/plugins/authenticator/src/u2f.rs b/plugins/authenticator/src/u2f.rs index b1f2e280..80eb9497 100644 --- a/plugins/authenticator/src/u2f.rs +++ b/plugins/authenticator/src/u2f.rs @@ -15,7 +15,7 @@ static VERSION: &str = "U2F_V2"; pub fn make_challenge(app_id: &str, challenge_bytes: Vec) -> Challenge { let utc: DateTime = Utc::now(); Challenge { - challenge: encode_config(&challenge_bytes, URL_SAFE_NO_PAD), + challenge: encode_config(challenge_bytes, URL_SAFE_NO_PAD), timestamp: format!("{:?}", utc), app_id: app_id.to_string(), } @@ -35,10 +35,10 @@ pub fn verify_registration( register_data: String, client_data: String, ) -> crate::Result { - let challenge_bytes = decode_config(&challenge, URL_SAFE_NO_PAD)?; + let challenge_bytes = decode_config(challenge, URL_SAFE_NO_PAD)?; let challenge = make_challenge(&app_id, challenge_bytes); let client_data_bytes: Vec = client_data.as_bytes().into(); - let client_data_base64 = encode_config(&client_data_bytes, URL_SAFE_NO_PAD); + let client_data_base64 = encode_config(client_data_bytes, URL_SAFE_NO_PAD); let client = U2f::new(app_id); match client.register_response( challenge, @@ -74,12 +74,12 @@ pub fn verify_signature( key_handle: String, pub_key: String, ) -> crate::Result { - let challenge_bytes = decode_config(&challenge, URL_SAFE_NO_PAD)?; + let challenge_bytes = decode_config(challenge, URL_SAFE_NO_PAD)?; let chal = make_challenge(&app_id, challenge_bytes); let client_data_bytes: Vec = client_data.as_bytes().into(); - let client_data_base64 = encode_config(&client_data_bytes, URL_SAFE_NO_PAD); + let client_data_base64 = encode_config(client_data_bytes, URL_SAFE_NO_PAD); let key_handle_bytes = decode_config(&key_handle, URL_SAFE_NO_PAD)?; - let pubkey_bytes = decode_config(&pub_key, URL_SAFE_NO_PAD)?; + let pubkey_bytes = decode_config(pub_key, URL_SAFE_NO_PAD)?; let client = U2f::new(app_id); let mut _counter: u32 = 0; match client.sign_response( diff --git a/plugins/persisted-scope/src/lib.rs b/plugins/persisted-scope/src/lib.rs index 6827e4cd..9fbdf4f7 100644 --- a/plugins/persisted-scope/src/lib.rs +++ b/plugins/persisted-scope/src/lib.rs @@ -56,13 +56,13 @@ pub fn init() -> TauriPlugin { .unwrap_or_default(); for allowed in scope.allowed_paths { // allows the path as is - let _ = fs_scope.allow_file(&allowed); + let _ = fs_scope.allow_file(allowed); #[cfg(feature = "protocol-asset")] let _ = asset_protocol_scope.allow_file(allowed); } for forbidden in scope.forbidden_patterns { // forbid the path as is - let _ = fs_scope.forbid_file(&forbidden); + let _ = fs_scope.forbid_file(forbidden); #[cfg(feature = "protocol-asset")] let _ = asset_protocol_scope.forbid_file(forbidden); } diff --git a/plugins/store/src/store.rs b/plugins/store/src/store.rs index 867bb0cd..af106e30 100644 --- a/plugins/store/src/store.rs +++ b/plugins/store/src/store.rs @@ -176,7 +176,7 @@ impl Store { .expect("failed to resolve app dir"); let store_path = app_dir.join(&self.path); - let bytes = read(&store_path)?; + let bytes = read(store_path)?; self.cache = (self.deserialize)(&bytes).map_err(Error::Deserialize)?;