Trait ResultInto

Source
pub trait ResultInto<T, E> {
    // Required method
    fn res_into(self) -> Result<T, E>;
}
Expand description

Maps both the Value and the Error of a Result using Into::into

Shorthand for result.map(Into::into).map_err(Into::into)

use err_into::ResultInto;

let res: Result<u8, i8> = Ok(0);
let _: Result<i32, i16> = res.res_into();

Required Methods§

Source

fn res_into(self) -> Result<T, E>

Implementations on Foreign Types§

Source§

impl<T, U, E, F> ResultInto<T, E> for Result<U, F>
where F: Into<E>, U: Into<T>,

Source§

fn res_into(self) -> Result<T, E>

Implementors§