]> git.lizzy.rs Git - rust.git/commitdiff
use same param name across methods
authorEsteban Küber <esteban@kuber.com.ar>
Fri, 23 Dec 2016 07:20:22 +0000 (23:20 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Fri, 23 Dec 2016 07:20:22 +0000 (23:20 -0800)
src/librustdoc/html/format.rs
src/librustdoc/html/render.rs

index 6808752b1fe05aa3436a6bb013bd302e96c17639..ed7ad36cc8468d6f85166192885d3bcf50415a7e 100644 (file)
@@ -561,14 +561,14 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
-fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, full_path: bool) -> fmt::Result {
+fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, use_absolute: bool) -> fmt::Result {
     match *t {
         clean::Generic(ref name) => {
             f.write_str(name)
         }
         clean::ResolvedPath{ did, ref typarams, ref path, is_generic } => {
             // Paths like T::Output and Self::Output should be rendered with all segments
-            resolved_path(f, did, path, is_generic, full_path)?;
+            resolved_path(f, did, path, is_generic, use_absolute)?;
             tybounds(f, typarams)
         }
         clean::Infer => write!(f, "_"),
@@ -727,7 +727,7 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, full_path: bool) -> fmt::Re
                 write!(f, "{}::", self_type)?;
             }
             let path = clean::Path::singleton(name.clone());
-            resolved_path(f, did, &path, true, full_path)?;
+            resolved_path(f, did, &path, true, use_absolute)?;
 
             // FIXME: `typarams` are not rendered, and this seems bad?
             drop(typarams);
@@ -752,7 +752,10 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
-fn fmt_impl(i: &clean::Impl, f: &mut fmt::Formatter, link_trait: bool, full: bool) -> fmt::Result {
+fn fmt_impl(i: &clean::Impl,
+            f: &mut fmt::Formatter,
+            link_trait: bool,
+            use_absolute: bool) -> fmt::Result {
     let mut plain = String::new();
 
     if f.alternate() {
@@ -786,7 +789,7 @@ fn fmt_impl(i: &clean::Impl, f: &mut fmt::Formatter, link_trait: bool, full: boo
         plain.push_str(" for ");
     }
 
-    fmt_type(&i.for_, f, full)?;
+    fmt_type(&i.for_, f, use_absolute)?;
     plain.push_str(&format!("{:#}", i.for_));
 
     fmt::Display::fmt(&WhereClause(&i.generics, plain.len() + 1), f)?;
@@ -802,8 +805,8 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 // The difference from above is that trait is not hyperlinked.
 pub fn fmt_impl_for_trait_page(i: &clean::Impl,
                                f: &mut fmt::Formatter,
-                               disambiguate: bool) -> fmt::Result {
-    fmt_impl(i, f, false, disambiguate)
+                               use_absolute: bool) -> fmt::Result {
+    fmt_impl(i, f, false, use_absolute)
 }
 
 impl fmt::Display for clean::Arguments {
index 5839c46d75d2a6b895e24ba6920580629091e337..dcf7515f87531beab35675eba92f0c9122ab3a3b 100644 (file)
@@ -2122,14 +2122,14 @@ fn trait_item(w: &mut fmt::Formatter, cx: &Context, m: &clean::Item, t: &clean::
             write!(w, "<li><code>")?;
             // If there's already another implementor that has the same abbridged name, use the
             // full path, for example in `std::iter::ExactSizeIterator`
-            let dissambiguate = if let clean::Type::ResolvedPath {
+            let use_absolute = if let clean::Type::ResolvedPath {
                 ref path, ..
             } = implementor.impl_.for_ {
                 implementor_count[path.last_name()] > 1
             } else {
                 false
             };
-            fmt_impl_for_trait_page(&implementor.impl_, w, dissambiguate)?;
+            fmt_impl_for_trait_page(&implementor.impl_, w, use_absolute)?;
             writeln!(w, "</code></li>")?;
         }
     }