complex: relax the FromStr trait requirements even more
This commit is contained in:
parent
16a180f132
commit
79c7a4be5f
|
@ -743,7 +743,7 @@ impl<T> fmt::Binary for Complex<T> where
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> FromStr for Complex<T> where
|
impl<T> FromStr for Complex<T> where
|
||||||
T: FromStr + Num + PartialOrd + Clone, T::Err: Error
|
T: FromStr + Num + Clone
|
||||||
{
|
{
|
||||||
type Err = ParseComplexError<T::Err>;
|
type Err = ParseComplexError<T::Err>;
|
||||||
|
|
||||||
|
@ -861,15 +861,13 @@ impl<T> serde::Deserialize for Complex<T> where
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub struct ParseComplexError<E> where
|
pub struct ParseComplexError<E>
|
||||||
E: Error
|
|
||||||
{
|
{
|
||||||
kind: ComplexErrorKind<E>,
|
kind: ComplexErrorKind<E>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
enum ComplexErrorKind<E> where
|
enum ComplexErrorKind<E>
|
||||||
E: Error
|
|
||||||
{
|
{
|
||||||
ParseError(E),
|
ParseError(E),
|
||||||
ExprError
|
ExprError
|
||||||
|
|
Loading…
Reference in New Issue