complex: Simplify the from_str signature
This commit is contained in:
parent
79c7a4be5f
commit
bd22a89a32
|
@ -748,7 +748,7 @@ impl<T> FromStr for Complex<T> where
|
||||||
type Err = ParseComplexError<T::Err>;
|
type Err = ParseComplexError<T::Err>;
|
||||||
|
|
||||||
/// Parses `a +/- bi`; `ai +/- b`; `a`; or `bi` where `a` and `b` are of type `T`
|
/// Parses `a +/- bi`; `ai +/- b`; `a`; or `bi` where `a` and `b` are of type `T`
|
||||||
fn from_str(s: &str) -> Result<Complex<T>, ParseComplexError<T::Err>>
|
fn from_str(s: &str) -> Result<Self, Self::Err>
|
||||||
{
|
{
|
||||||
let imag = match s.rfind('j') {
|
let imag = match s.rfind('j') {
|
||||||
None => 'i',
|
None => 'i',
|
||||||
|
|
Loading…
Reference in New Issue