about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-08-19 15:54:37 +0900
committerGitHub <noreply@github.com>2020-08-19 15:54:37 +0900
commit98f7d882c8ebd4e505fc407ed261b48c2f54c697 (patch)
tree88518cfc0b3243290a63db734a35593df824fd26 /src/librustdoc/html
parente6fe5232df75246921f8b89d0161e4508f1cc535 (diff)
parentf957bae74eb4e8847b0c0af5cd2c01812b110fc0 (diff)
downloadrust-98f7d882c8ebd4e505fc407ed261b48c2f54c697.tar.gz
rust-98f7d882c8ebd4e505fc407ed261b48c2f54c697.zip
Rollup merge of #75665 - GuillaumeGomez:doc-examples-coverage, r=jyn514
Add doc examples coverage

r? @jyn514
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/render/cache.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs
index 5a9e9dda677..ccc07645620 100644
--- a/src/librustdoc/html/render/cache.rs
+++ b/src/librustdoc/html/render/cache.rs
@@ -200,10 +200,12 @@ fn get_index_type_name(clean_type: &clean::Type, accept_generic: bool) -> Option
     match *clean_type {
         clean::ResolvedPath { ref path, .. } => {
             let segments = &path.segments;
-            let path_segment = segments.iter().last().unwrap_or_else(|| panic!(
+            let path_segment = segments.iter().last().unwrap_or_else(|| {
+                panic!(
                 "get_index_type_name(clean_type: {:?}, accept_generic: {:?}) had length zero path",
                 clean_type, accept_generic
-            ));
+            )
+            });
             Some(path_segment.name.clone())
         }
         clean::Generic(ref s) if accept_generic => Some(s.clone()),