We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
TryFrom
Into
From
1 parent f4a421e commit f8bd80aCopy full SHA for f8bd80a
src/libcore/convert.rs
@@ -476,11 +476,11 @@ impl<T, U> TryInto<U> for T where U: TryFrom<T>
476
// Infallible conversions are semantically equivalent to fallible conversions
477
// with an uninhabited error type.
478
#[unstable(feature = "try_from", issue = "33417")]
479
-impl<T, U> TryFrom<U> for T where T: From<U> {
+impl<T, U> TryFrom<U> for T where U: Into<T> {
480
type Error = !;
481
482
fn try_from(value: U) -> Result<Self, Self::Error> {
483
- Ok(T::from(value))
+ Ok(U::into(value))
484
}
485
486
0 commit comments