Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
trait CouldYouNot<T> {
fn could_you_not_pls(self) -> T;
}
impl<T> CouldYouNot<T> for Option<T> {
fn could_you_not_pls(self) -> T {
self.expect("ಠ_ಠ")
}
}
impl<T, E: std::fmt::Debug> CouldYouNot<T> for Result<T, E> {
fn could_you_not_pls(self) -> T {
self.expect("ಠ_ಠ")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment