Skip to content

Instantly share code, notes, and snippets.

@loverdos
Created October 25, 2024 12:15
Show Gist options
  • Save loverdos/4709c1bba048cd4d99f353924eb3e684 to your computer and use it in GitHub Desktop.
Save loverdos/4709c1bba048cd4d99f353924eb3e684 to your computer and use it in GitHub Desktop.
ok.rs
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