diff --git a/attestation-ca/build.rs b/attestation-ca/build.rs index 4435e79a..8df71d86 100644 --- a/attestation-ca/build.rs +++ b/attestation-ca/build.rs @@ -4,6 +4,7 @@ const OPENSSL_DOC: &str = "https://github.com/kanidm/webauthn-rs/blob/master/Ope fn main() { // LibreSSL reports as OpenSSL v2 (which was skipped). + #[allow(clippy::unusual_byte_groupings)] if number() < 0x2_00_00_00_0 { println!( r#" diff --git a/base64urlsafedata/src/common.rs b/base64urlsafedata/src/common.rs index 44e3fad2..c1bba047 100644 --- a/base64urlsafedata/src/common.rs +++ b/base64urlsafedata/src/common.rs @@ -15,6 +15,12 @@ macro_rules! common_impls { } } + impl Default for $type { + fn default() -> Self { + Self::new() + } + } + impl std::ops::Deref for $type { type Target = Vec; diff --git a/tutorial/wasm/src/lib.rs b/tutorial/wasm/src/lib.rs index 5fc01316..78465c30 100644 --- a/tutorial/wasm/src/lib.rs +++ b/tutorial/wasm/src/lib.rs @@ -59,7 +59,7 @@ impl App { return AppState::Error("A username must be provided".to_string()); } - self.last_username = username.clone(); + self.last_username.clone_from(&username); // The fetch is done in a future/promise. ctx.link().send_future(async { @@ -226,7 +226,7 @@ impl App { return AppState::Error("A username must be provided".to_string()); } - self.last_username = username.clone(); + self.last_username.clone_from(&username); // The fetch is done in a future/promise. ctx.link().send_future(async { diff --git a/webauthn-authenticator-rs/src/ctap2/ctap21_cred.rs b/webauthn-authenticator-rs/src/ctap2/ctap21_cred.rs index 7c40641a..e332386e 100644 --- a/webauthn-authenticator-rs/src/ctap2/ctap21_cred.rs +++ b/webauthn-authenticator-rs/src/ctap2/ctap21_cred.rs @@ -50,6 +50,7 @@ where ) -> Result; /// Send a [CredSubCommand] using a provided `pin_uv_auth_token` session. + #[allow(dead_code)] async fn cred_mgmt_with_session( &mut self, sub_command: CredSubCommand, diff --git a/webauthn-rs-core/build.rs b/webauthn-rs-core/build.rs index 6ad6d83f..d34d77cc 100644 --- a/webauthn-rs-core/build.rs +++ b/webauthn-rs-core/build.rs @@ -4,6 +4,7 @@ const OPENSSL_DOC: &str = "https://github.com/kanidm/webauthn-rs/blob/master/Ope fn main() { // LibreSSL reports as OpenSSL v2. + #[allow(clippy::unusual_byte_groupings)] if number() < 0x2_00_00_00_0 { println!( r#" diff --git a/webauthn-rs-proto/src/options.rs b/webauthn-rs-proto/src/options.rs index c2801082..41224112 100644 --- a/webauthn-rs-proto/src/options.rs +++ b/webauthn-rs-proto/src/options.rs @@ -3,6 +3,7 @@ use base64urlsafedata::Base64UrlSafeData; use serde::{Deserialize, Serialize}; +use std::fmt::Display; use std::{collections::BTreeMap, str::FromStr}; /// Defines the User Authenticator Verification policy. This is documented @@ -163,8 +164,14 @@ impl FromStr for AuthenticatorTransport { } } -impl ToString for AuthenticatorTransport { - fn to_string(&self) -> String { +impl Display for AuthenticatorTransport { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(self.as_ref()) + } +} + +impl AsRef for AuthenticatorTransport { + fn as_ref(&self) -> &'static str { use AuthenticatorTransport::*; match self { Usb => "usb", @@ -175,7 +182,6 @@ impl ToString for AuthenticatorTransport { Hybrid => "hybrid", Unknown => "unknown", } - .to_string() } } diff --git a/webauthn-rs-proto/src/wasm.rs b/webauthn-rs-proto/src/wasm.rs index 4591acd3..d2ea57bb 100644 --- a/webauthn-rs-proto/src/wasm.rs +++ b/webauthn-rs-proto/src/wasm.rs @@ -3,6 +3,7 @@ use wasm_bindgen::prelude::*; #[wasm_bindgen] extern "C" { + /// Public Key Credential Extension pub type PublicKeyCredentialExt; #[wasm_bindgen(static_method_of = PublicKeyCredentialExt, js_class = "PublicKeyCredential", js_name = isConditionalMediationAvailable, catch)]