]> git.lizzy.rs Git - rust.git/commitdiff
Remove unneeded extra chars to reduce search-index size
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 11 Dec 2018 09:57:45 +0000 (10:57 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 11 Dec 2018 21:29:43 +0000 (22:29 +0100)
src/librustdoc/html/markdown.rs

index 00ca4fed2f4a008e73eb1ecf23cf73d446884c30..2ffde297cc506e7fe7ffec391b64d42c3fcfde4d 100644 (file)
@@ -852,7 +852,11 @@ fn next(&mut self) -> Option<String> {
             s.push_str(&t);
         }
     }
-    s
+    if s.len() > 60 {
+        s.chars().take(60).collect::<String>()
+    } else {
+        s
+    }
 }
 
 pub fn markdown_links(md: &str) -> Vec<(String, Option<Range<usize>>)> {