about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-07-28 16:25:07 +0800
committerGitHub <noreply@github.com>2018-07-28 16:25:07 +0800
commit59f8422a17c136582aeecf0c975deb6896df3595 (patch)
tree13701b9aa44e1764ead0c9c032d9b72324d7e142 /src/librustdoc/html
parentf0efbc0d6bcb63f9a520407ff557048664b67a50 (diff)
parent1cca4204357454dbf2e2b7f57f9f024631da209f (diff)
downloadrust-59f8422a17c136582aeecf0c975deb6896df3595.tar.gz
rust-59f8422a17c136582aeecf0c975deb6896df3595.zip
Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis
Use a slice where a vector is not necessary
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/render.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index f137f4acf44..81fef9bf83e 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -2690,7 +2690,7 @@ fn render_implementor(cx: &Context, implementor: &Impl, w: &mut fmt::Formatter,
     for it in &implementor.inner_impl().items {
         if let clean::TypedefItem(ref tydef, _) = it.inner {
             write!(w, "<span class=\"where fmt-newline\">  ")?;
-            assoc_type(w, it, &vec![], Some(&tydef.type_), AssocItemLink::Anchor(None))?;
+            assoc_type(w, it, &[], Some(&tydef.type_), AssocItemLink::Anchor(None))?;
             write!(w, ";</span>")?;
         }
     }
@@ -3040,7 +3040,7 @@ fn assoc_const(w: &mut fmt::Formatter,
 }
 
 fn assoc_type<W: fmt::Write>(w: &mut W, it: &clean::Item,
-                             bounds: &Vec<clean::GenericBound>,
+                             bounds: &[clean::GenericBound],
                              default: Option<&clean::Type>,
                              link: AssocItemLink) -> fmt::Result {
     write!(w, "type <a href='{}' class=\"type\">{}</a>",
@@ -3749,7 +3749,7 @@ fn spotlight_decl(decl: &clean::FnDecl) -> Result<String, fmt::Error> {
                     for it in &impl_.items {
                         if let clean::TypedefItem(ref tydef, _) = it.inner {
                             out.push_str("<span class=\"where fmt-newline\">    ");
-                            assoc_type(&mut out, it, &vec![],
+                            assoc_type(&mut out, it, &[],
                                        Some(&tydef.type_),
                                        AssocItemLink::GotoSource(t_did, &FxHashSet()))?;
                             out.push_str(";</span>");