diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index 661aef664823d..952541bb85f9b 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) -> Lifetime { + fn get_lifetime( + &self, region: Region<'_>, + names_map: &FxHashMap + ) -> 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 136b28f36aee5..9664cae5a68c4 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) +pub fn try_inline( + cx: &DocContext<'_, '_, '_>, + def: Def, + name: ast::Name, + visited: &mut FxHashSet +) -> Option> { 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, did: DefId, visited: &mut FxHashSet) -> clean::Module { +fn build_module( + cx: &DocContext<'_, '_, '_>, + did: DefId, + visited: &mut FxHashSet +) -> 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 626c2802e8390..172bd9180622f 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -3523,23 +3523,37 @@ pub struct Impl { pub blanket_impl: Option, } -pub fn get_auto_traits_with_node_id(cx: &DocContext<'_, '_, '_>, id: ast::NodeId, name: String) -> Vec { +pub fn get_auto_traits_with_node_id( + cx: &DocContext<'_, '_, '_>, + id: ast::NodeId, + name: String +) -> Vec { 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 { +pub fn get_auto_traits_with_def_id( + cx: &DocContext<'_, '_, '_>, + id: DefId +) -> Vec { 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 { +pub fn get_blanket_impls_with_node_id( + cx: &DocContext<'_, '_, '_>, + id: ast::NodeId, + name: String +) -> Vec { 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 { +pub fn get_blanket_impls_with_def_id( + cx: &DocContext<'_, '_, '_>, + id: DefId +) -> Vec { let finder = BlanketImplFinder::new(cx); finder.get_with_def_id(id) @@ -4095,7 +4109,11 @@ impl Clean for hir::TypeBinding { } } -pub fn def_id_to_path(cx: &DocContext<'_, '_, '_>, did: DefId, name: Option) -> Vec { +pub fn def_id_to_path( + cx: &DocContext<'_, '_, '_>, + did: DefId, + name: Option +) -> Vec { 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 6bbc0bc49d3db..5109e775ebf81 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]({})",