瀏覽代碼

complex: Simplify the from_str signature

Josh Stone 7 年之前
父節點
當前提交
bd22a89a32
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      complex/src/lib.rs

+ 1 - 1
complex/src/lib.rs

@@ -748,7 +748,7 @@ impl<T> FromStr for Complex<T> where
     type Err = ParseComplexError<T::Err>;
 
     /// 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') {
             None => 'i',