From ec9c03c0a21f9220b44f85a4734feca532b89e43 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 16 Dec 2018 12:28:46 +0100 Subject: Make hidden life time parameters explicit This patch makes hidden life time parameters explicit to fix elided-lifetime-in-path compiler warnings. --- src/pws.rs | 8 ++++---- src/util.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pws.rs b/src/pws.rs index c20fe9d..f283d2b 100644 --- a/src/pws.rs +++ b/src/pws.rs @@ -98,7 +98,7 @@ pub trait GetPasswordSafe { /// [`lock`]: trait.Device.html#method.lock /// [`InvalidString`]: enum.CommandError.html#variant.InvalidString /// [`WrongPassword`]: enum.CommandError.html#variant.WrongPassword - fn get_password_safe(&self, user_pin: &str) -> Result; + fn get_password_safe(&self, user_pin: &str) -> Result, CommandError>; } fn get_password_safe<'a>( @@ -333,19 +333,19 @@ impl<'a> Drop for PasswordSafe<'a> { } impl GetPasswordSafe for Pro { - fn get_password_safe(&self, user_pin: &str) -> Result { + fn get_password_safe(&self, user_pin: &str) -> Result, CommandError> { get_password_safe(self, user_pin) } } impl GetPasswordSafe for Storage { - fn get_password_safe(&self, user_pin: &str) -> Result { + fn get_password_safe(&self, user_pin: &str) -> Result, CommandError> { get_password_safe(self, user_pin) } } impl GetPasswordSafe for DeviceWrapper { - fn get_password_safe(&self, user_pin: &str) -> Result { + fn get_password_safe(&self, user_pin: &str) -> Result, CommandError> { get_password_safe(self, user_pin) } } diff --git a/src/util.rs b/src/util.rs index 6f4fbb0..2a75634 100644 --- a/src/util.rs +++ b/src/util.rs @@ -115,7 +115,7 @@ pub fn get_cstring>>(s: T) -> Result { } impl fmt::Display for CommandError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let msg = match *self { CommandError::WrongCrc => "A packet with a wrong checksum has been sent or received", CommandError::WrongSlot => "The given OTP slot does not exist", -- cgit v1.2.1