mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-10 18:55:57 +03:00
Updated dependencies to use u2f crate directly, and some style changes
This commit is contained in:
@@ -76,17 +76,17 @@ impl Error {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait MapResult<S, E> {
|
||||
fn map_res(self, msg: &str) -> Result<S, E>;
|
||||
pub trait MapResult<S> {
|
||||
fn map_res(self, msg: &str) -> Result<S, Error>;
|
||||
}
|
||||
|
||||
impl<S, E: Into<Error>> MapResult<S, Error> for Result<S, E> {
|
||||
impl<S, E: Into<Error>> MapResult<S> for Result<S, E> {
|
||||
fn map_res(self, msg: &str) -> Result<S, Error> {
|
||||
self.map_err(|e| e.into().with_msg(msg))
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: Into<Error>> MapResult<(), Error> for Result<usize, E> {
|
||||
impl<E: Into<Error>> MapResult<()> for Result<usize, E> {
|
||||
fn map_res(self, msg: &str) -> Result<(), Error> {
|
||||
self.and(Ok(())).map_res(msg)
|
||||
}
|
||||
|
Reference in New Issue
Block a user