diff options
| -rw-r--r-- | src/librustdoc/clean/auto_trait.rs | 5 | ||||
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 13 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 28 | ||||
| -rw-r--r-- | src/librustdoc/html/render.rs | 9 |
4 files changed, 45 insertions, 10 deletions
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index 661aef66482..952541bb85f 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -220,7 +220,10 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> { } } - fn get_lifetime(&self, region: Region<'_>, names_map: &FxHashMap<String, Lifetime>) -> Lifetime { + fn get_lifetime( + &self, region: Region<'_>, + names_map: &FxHashMap<String, Lifetime> + ) -> Lifetime { self.region_name(region) .map(|name| { names_map.get(&name).unwrap_or_else(|| { diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 136b28f36ae..9664cae5a68 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -35,7 +35,12 @@ use super::Clean; /// /// The returned value is `None` if the definition could not be inlined, /// and `Some` of a vector of items if it was successfully expanded. -pub fn try_inline(cx: &DocContext<'_, '_, '_>, def: Def, name: ast::Name, visited: &mut FxHashSet<DefId>) +pub fn try_inline( + cx: &DocContext<'_, '_, '_>, + def: Def, + name: ast::Name, + visited: &mut FxHashSet<DefId> +) -> Option<Vec<clean::Item>> { let did = if let Some(did) = def.opt_def_id() { did @@ -387,7 +392,11 @@ pub fn build_impl(cx: &DocContext<'_, '_, '_>, did: DefId, ret: &mut Vec<clean:: }); } -fn build_module(cx: &DocContext<'_, '_, '_>, did: DefId, visited: &mut FxHashSet<DefId>) -> clean::Module { +fn build_module( + cx: &DocContext<'_, '_, '_>, + did: DefId, + visited: &mut FxHashSet<DefId> +) -> clean::Module { let mut items = Vec::new(); fill_in(cx, did, &mut items, visited); return clean::Module { diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 626c2802e83..172bd918062 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -3523,23 +3523,37 @@ pub struct Impl { pub blanket_impl: Option<Type>, } -pub fn get_auto_traits_with_node_id(cx: &DocContext<'_, '_, '_>, id: ast::NodeId, name: String) -> Vec<Item> { +pub fn get_auto_traits_with_node_id( + cx: &DocContext<'_, '_, '_>, + id: ast::NodeId, + name: String +) -> Vec<Item> { let finder = AutoTraitFinder::new(cx); finder.get_with_node_id(id, name) } -pub fn get_auto_traits_with_def_id(cx: &DocContext<'_, '_, '_>, id: DefId) -> Vec<Item> { +pub fn get_auto_traits_with_def_id( + cx: &DocContext<'_, '_, '_>, + id: DefId +) -> Vec<Item> { let finder = AutoTraitFinder::new(cx); finder.get_with_def_id(id) } -pub fn get_blanket_impls_with_node_id(cx: &DocContext<'_, '_, '_>, id: ast::NodeId, name: String) -> Vec<Item> { +pub fn get_blanket_impls_with_node_id( + cx: &DocContext<'_, '_, '_>, + id: ast::NodeId, + name: String +) -> Vec<Item> { let finder = BlanketImplFinder::new(cx); finder.get_with_node_id(id, name) } -pub fn get_blanket_impls_with_def_id(cx: &DocContext<'_, '_, '_>, id: DefId) -> Vec<Item> { +pub fn get_blanket_impls_with_def_id( + cx: &DocContext<'_, '_, '_>, + id: DefId +) -> Vec<Item> { let finder = BlanketImplFinder::new(cx); finder.get_with_def_id(id) @@ -4095,7 +4109,11 @@ impl Clean<TypeBinding> for hir::TypeBinding { } } -pub fn def_id_to_path(cx: &DocContext<'_, '_, '_>, did: DefId, name: Option<String>) -> Vec<String> { +pub fn def_id_to_path( + cx: &DocContext<'_, '_, '_>, + did: DefId, + name: Option<String> +) -> Vec<String> { let crate_name = name.unwrap_or_else(|| cx.tcx.crate_name(did.krate).to_string()); let relative = cx.tcx.def_path(did).data.into_iter().filter_map(|elem| { // extern blocks have an empty name diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 6bbc0bc49d3..5109e775ebf 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -2541,8 +2541,13 @@ fn render_markdown(w: &mut fmt::Formatter<'_>, cx.codes)) } -fn document_short(w: &mut fmt::Formatter<'_>, cx: &Context, item: &clean::Item, link: AssocItemLink<'_>, - prefix: &str, is_hidden: bool) -> fmt::Result { +fn document_short( + w: &mut fmt::Formatter<'_>, + cx: &Context, + item: &clean::Item, + link: AssocItemLink<'_>, + prefix: &str, is_hidden: bool +) -> fmt::Result { if let Some(s) = item.doc_value() { let markdown = if s.contains('\n') { format!("{} [Read more]({})", |
