Rollup merge of #75665 - GuillaumeGomez:doc-examples-coverage, r=jyn514

Add doc examples coverage

r? @jyn514
This commit is contained in:
Yuki Okushi 2020-08-19 15:54:37 +09:00 committed by GitHub
commit 98f7d882c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 173 additions and 77 deletions

View file

@ -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()),