about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-02-29 10:43:32 +0000
committerbors <bors@rust-lang.org>2020-02-29 10:43:32 +0000
commit3f9bddc7fea3ca1d49f39f22bb937a84ed32f84e (patch)
treef832b09e3ffce6a55b209ef234a99c06742d18eb /src/librustdoc/html
parent04e7f96dd89b1f0ad615dff1c85d11d4c4c64cb4 (diff)
parentbbfec7ca41887af04abb4510677c4539a95f03a2 (diff)
downloadrust-3f9bddc7fea3ca1d49f39f22bb937a84ed32f84e.tar.gz
rust-3f9bddc7fea3ca1d49f39f22bb937a84ed32f84e.zip
Auto merge of #69570 - Dylan-DPC:rollup-d6boczt, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #69477 (docs: add mention of async blocks in move keyword docs)
 - #69504 (Use assert_ne in hash tests)
 - #69546 (use to_vec() instead of .iter().cloned().collect() to convert slices to vecs.)
 - #69551 (use is_empty() instead of len() == x  to determine if structs are empty.)
 - #69563 (Fix no_std detection for target triples)
 - #69567 (use .to_string() instead of format!() macro to create strings)

Failed merges:

r? @ghost
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 59677b28245..54d5a2efc8a 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -2783,7 +2783,7 @@ fn assoc_type(
 
 fn render_stability_since_raw(w: &mut Buffer, ver: Option<&str>, containing_ver: Option<&str>) {
     if let Some(v) = ver {
-        if containing_ver != ver && v.len() > 0 {
+        if containing_ver != ver && !v.is_empty() {
             write!(w, "<span class='since' title='Stable since Rust version {0}'>{0}</span>", v)
         }
     }
@@ -3143,7 +3143,7 @@ fn render_attribute(attr: &ast::MetaItem) -> Option<String> {
             .filter_map(|attr| attr.meta_item().and_then(|mi| render_attribute(mi)))
             .collect();
 
-        if display.len() > 0 { Some(format!("{}({})", path, display.join(", "))) } else { None }
+        if !display.is_empty() { Some(format!("{}({})", path, display.join(", "))) } else { None }
     } else {
         None
     }
@@ -3178,7 +3178,7 @@ fn render_attributes(w: &mut Buffer, it: &clean::Item, top: bool) {
             attrs.push_str(&format!("#[{}]\n", s));
         }
     }
-    if attrs.len() > 0 {
+    if !attrs.is_empty() {
         write!(
             w,
             "<span class=\"docblock attributes{}\">{}</span>",