Skip to content

Commit

Permalink
chasing clippy fixes (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaleman authored May 15, 2024
1 parent 826dc1b commit 6f4688d
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions attestation-ca/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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#"
Expand Down
6 changes: 6 additions & 0 deletions base64urlsafedata/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8>;

Expand Down
4 changes: 2 additions & 2 deletions tutorial/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions webauthn-authenticator-rs/src/ctap2/ctap21_cred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ where
) -> Result<CredentialManagementResponse, WebauthnCError>;

/// 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,
Expand Down
1 change: 1 addition & 0 deletions webauthn-rs-core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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#"
Expand Down
12 changes: 9 additions & 3 deletions webauthn-rs-proto/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<str> for AuthenticatorTransport {
fn as_ref(&self) -> &'static str {
use AuthenticatorTransport::*;
match self {
Usb => "usb",
Expand All @@ -175,7 +182,6 @@ impl ToString for AuthenticatorTransport {
Hybrid => "hybrid",
Unknown => "unknown",
}
.to_string()
}
}

Expand Down
1 change: 1 addition & 0 deletions webauthn-rs-proto/src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 6f4688d

Please sign in to comment.