Skip to content

Instantly share code, notes, and snippets.

@qatoqat
Created March 6, 2025 17:54
Show Gist options
  • Select an option

  • Save qatoqat/261b30653cc3b06a5e30c3045c519a21 to your computer and use it in GitHub Desktop.

Select an option

Save qatoqat/261b30653cc3b06a5e30c3045c519a21 to your computer and use it in GitHub Desktop.
ok shortcut
pub trait IntoOk<T> {
fn ok(self) -> anyhow::Result<T>;
}
impl<T> IntoOk<T> for T {
fn ok(self) -> anyhow::Result<T> {
Ok(self)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment