Created
October 25, 2024 12:15
-
-
Save loverdos/4709c1bba048cd4d99f353924eb3e684 to your computer and use it in GitHub Desktop.
ok.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait IAmOk { | |
type T; | |
fn ok(self) -> Result<Self::T>; | |
} | |
impl<T> IAmOk for T { | |
type T = T; | |
fn ok(self) -> Result<Self::T> { | |
Ok(self) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment