Skip to content

Commit c5deb31

Browse files
committed
Apply some cargo clippy fixes
1 parent a623f38 commit c5deb31

5 files changed

Lines changed: 17 additions & 8 deletions

File tree

xyz-iinuwa-credential-manager-portal-gtk/src/credential_service/hybrid.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ impl HybridHandler for InternalHybridHandler {
5555
panic!();
5656
}
5757
};
58+
if let Err(err) = tx.send(HybridStateInternal::Connected).await {
59+
tracing::error!("Failed to send caBLE update: {:?}", err)
60+
}
5861
let response: AuthenticatorResponse = loop {
5962
match &request {
6063
CredentialRequest::CreatePublicKeyCredentialRequest(make_request) => {

xyz-iinuwa-credential-manager-portal-gtk/src/credential_service/server.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use super::hybrid::{HybridHandler, HybridState};
1313
use super::usb::{UsbHandler, UsbState};
1414
use super::CredentialService;
1515

16+
#[allow(clippy::enum_variant_names)]
1617
pub enum ServiceRequest {
1718
GetDevices,
1819
GetHybridCredential,

xyz-iinuwa-credential-manager-portal-gtk/src/view_model/gtk/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ impl ViewModel {
284284
todo!();
285285
}
286286
}
287-
self.set_selected_device(&device.into());
287+
let device_object: DeviceObject = device.into();
288+
self.set_selected_device(device_object);
288289
self.set_selected_credential("");
289290
}
290291

xyz-iinuwa-credential-manager-portal-gtk/src/view_model/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use async_std::{
77
channel::{Receiver, Sender},
88
sync::Mutex,
99
};
10-
use tokio::sync::{mpsc, oneshot};
10+
use tokio::sync::mpsc;
1111
use tracing::{error, info};
1212

1313
use crate::credential_service::{CredentialServiceClient, UsbState};
@@ -152,7 +152,11 @@ impl<C: CredentialServiceClient + Send> ViewModel<C> {
152152
todo!();
153153
}
154154
};
155-
self.selected_credential = None;
155+
// Remove the attribute below when we implement cancellation for at least one transport.
156+
#[allow(unreachable_code)]
157+
{
158+
self.selected_credential = None;
159+
}
156160
}
157161

158162
// start discovery for newly selected device
@@ -264,7 +268,7 @@ impl<C: CredentialServiceClient + Send> ViewModel<C> {
264268
}
265269
Event::View(ViewEvent::UsbPinEntered(pin)) => {
266270
if let Some(pin_tx) = self.usb_pin_tx.take() {
267-
if let Err(_) = pin_tx.lock().await.send(pin).await {
271+
if pin_tx.lock().await.send(pin).await.is_err() {
268272
error!("Failed to send pin to device");
269273
}
270274
}

xyz-iinuwa-credential-manager-portal-gtk/src/webauthn.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ impl TryFrom<CredentialDescriptor> for Ctap2PublicKeyCredentialDescriptor {
254254
#[zvariant(signature = "dict")]
255255
/// https://www.w3.org/TR/webauthn-3/#dictionary-authenticatorSelection
256256
pub(crate) struct AuthenticatorSelectionCriteria {
257-
/// https://www.w3.org/TR/webauthn-3/#enum-attachment
258-
#[zvariant(rename = "authenticatorAttachment")]
259-
pub authenticator_attachment: Option<String>,
260-
257+
// /// https://www.w3.org/TR/webauthn-3/#enum-attachment
258+
// #[zvariant(rename = "authenticatorAttachment")]
259+
// pub authenticator_attachment: Option<String>,
260+
//
261261
/// https://www.w3.org/TR/webauthn-3/#enum-residentKeyRequirement
262262
#[zvariant(rename = "residentKey")]
263263
pub resident_key: Option<String>,

0 commit comments

Comments
 (0)