Rollup merge of #70990 - GuillaumeGomez:rustdoc-cleanup, r=ollie27
Improve rustdoc source code a bit Very small clean up. I realized that there were too many nested conditions whereas we could just use `and_then`. r? @kinnison cc @ollie27
This commit is contained in:
commit
9433d899a7
2 changed files with 25 additions and 29 deletions
|
|
@ -697,11 +697,11 @@ fn get_generics(clean_type: &clean::Type) -> Option<Vec<Generic>> {
|
|||
let r = types
|
||||
.iter()
|
||||
.filter_map(|t| {
|
||||
if let Some(name) = get_index_type_name(t, false) {
|
||||
Some(Generic { name: name.to_ascii_lowercase(), defid: t.def_id(), idx: None })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
get_index_type_name(t, false).map(|name| Generic {
|
||||
name: name.to_ascii_lowercase(),
|
||||
defid: t.def_id(),
|
||||
idx: None,
|
||||
})
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
if r.is_empty() { None } else { Some(r) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue