Skip to content

Commit 6f913a2

Browse files
committed
Review update
1 parent 75179d6 commit 6f913a2

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/errors.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl fmt::Display for AuthenticatorError {
4545
"no transports were configured in the authenticator service"
4646
),
4747
AuthenticatorError::Platform => write!(f, "unknown platform error"),
48-
AuthenticatorError::InternalError(ref err) => write!(f, "internal error: {:?}", err),
48+
AuthenticatorError::InternalError(ref err) => write!(f, "internal error: {}", err),
4949
AuthenticatorError::U2FToken(ref err) => {
5050
write!(f, "A u2f token error occurred {:?}", err)
5151
}
@@ -76,7 +76,6 @@ pub enum U2FTokenError {
7676
}
7777

7878
impl U2FTokenError {
79-
#[allow(dead_code)]
8079
fn as_str(&self) -> &str {
8180
match *self {
8281
U2FTokenError::Unknown => "unknown",
@@ -90,7 +89,7 @@ impl U2FTokenError {
9089

9190
impl std::fmt::Display for U2FTokenError {
9291
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
93-
write!(f, "{:?}", self)
92+
write!(f, "{}", self.as_str())
9493
}
9594
}
9695

src/manager.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,11 @@ impl AuthenticatorTransport for U2FManager {
184184
status,
185185
callback,
186186
};
187-
self.tx
188-
.send(action)
189-
.map_err(|e| AuthenticatorError::from(e))
187+
Ok(self.tx.send(action)?)
190188
}
191189

192190
fn cancel(&mut self) -> crate::Result<()> {
193-
self.tx
194-
.send(QueueAction::Cancel)
195-
.map_err(|e| AuthenticatorError::from(e))
191+
Ok(self.tx.send(QueueAction::Cancel)?)
196192
}
197193
}
198194

0 commit comments

Comments
 (0)