Skip to content

Instantly share code, notes, and snippets.

@shun-shobon
Created September 7, 2023 09:32
Show Gist options
  • Save shun-shobon/dedff36a28d7bb7ec1eb415c5ba91ff1 to your computer and use it in GitHub Desktop.
Save shun-shobon/dedff36a28d7bb7ec1eb415c5ba91ff1 to your computer and use it in GitHub Desktop.
Into with turbofish
trait IntoT {
fn intot<Dst>(self) -> Dst
where
Self: Into<Dst>;
}
impl<T> IntoT for T {
#[inline]
fn intot<Dst>(self) -> Dst
where
Self: Into<Dst>,
{
self.into()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment