rust-lib/src/traits.rs

6 lines
138 B
Rust
Raw Normal View History

/// Converts a type T into a Result<T, E>
pub trait IntoResult<T> {
type Error;
fn into_result(self) -> Result<T, Self::Error>;
}