Change bounds on TryFrom blanket impl to use Into instead of From
This commit is contained in:
parent
f4a421ee3c
commit
f8bd80a830
1 changed files with 2 additions and 2 deletions
|
|
@ -476,11 +476,11 @@ impl<T, U> TryInto<U> for T where U: TryFrom<T>
|
|||
// Infallible conversions are semantically equivalent to fallible conversions
|
||||
// with an uninhabited error type.
|
||||
#[unstable(feature = "try_from", issue = "33417")]
|
||||
impl<T, U> TryFrom<U> for T where T: From<U> {
|
||||
impl<T, U> TryFrom<U> for T where U: Into<T> {
|
||||
type Error = !;
|
||||
|
||||
fn try_from(value: U) -> Result<Self, Self::Error> {
|
||||
Ok(T::from(value))
|
||||
Ok(U::into(value))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue