Created
September 28, 2023 12:46
-
-
Save tesaguri/9c37e1ce2e8969957a2d5e6efeae5865 to your computer and use it in GitHub Desktop.
Too Many Questions
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
#![feature(try_trait_v2)] | |
use core::ops::{ControlFlow, FromResidual, Try}; | |
#[allow(dead_code)] | |
fn questions(x: Undemystifiable) -> Undemystifiable { | |
x???????????????????????????????????????????????????????????????? | |
} | |
struct Undemystifiable; | |
impl Try for Undemystifiable { | |
type Output = Self; | |
type Residual = Self; | |
fn from_output(output: Self::Output) -> Self { | |
output | |
} | |
fn branch(self) -> ControlFlow<Self::Residual, Self::Output> { | |
ControlFlow::Continue(Self) | |
} | |
} | |
impl FromResidual<Undemystifiable> for Undemystifiable { | |
fn from_residual(residual: Undemystifiable) -> Self { | |
residual | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment