Fix tidy check errors
This commit is contained in:
parent
1932d7a52d
commit
1fe87df104
4 changed files with 45 additions and 10 deletions
|
@ -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)
|
self.region_name(region)
|
||||||
.map(|name| {
|
.map(|name| {
|
||||||
names_map.get(&name).unwrap_or_else(|| {
|
names_map.get(&name).unwrap_or_else(|| {
|
||||||
|
|
|
@ -35,7 +35,12 @@ use super::Clean;
|
||||||
///
|
///
|
||||||
/// The returned value is `None` if the definition could not be inlined,
|
/// The returned value is `None` if the definition could not be inlined,
|
||||||
/// and `Some` of a vector of items if it was successfully expanded.
|
/// 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>> {
|
-> Option<Vec<clean::Item>> {
|
||||||
let did = if let Some(did) = def.opt_def_id() {
|
let did = if let Some(did) = def.opt_def_id() {
|
||||||
did
|
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();
|
let mut items = Vec::new();
|
||||||
fill_in(cx, did, &mut items, visited);
|
fill_in(cx, did, &mut items, visited);
|
||||||
return clean::Module {
|
return clean::Module {
|
||||||
|
|
|
@ -3523,23 +3523,37 @@ pub struct Impl {
|
||||||
pub blanket_impl: Option<Type>,
|
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);
|
let finder = AutoTraitFinder::new(cx);
|
||||||
finder.get_with_node_id(id, name)
|
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);
|
let finder = AutoTraitFinder::new(cx);
|
||||||
|
|
||||||
finder.get_with_def_id(id)
|
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);
|
let finder = BlanketImplFinder::new(cx);
|
||||||
finder.get_with_node_id(id, name)
|
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);
|
let finder = BlanketImplFinder::new(cx);
|
||||||
|
|
||||||
finder.get_with_def_id(id)
|
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 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| {
|
let relative = cx.tcx.def_path(did).data.into_iter().filter_map(|elem| {
|
||||||
// extern blocks have an empty name
|
// extern blocks have an empty name
|
||||||
|
|
|
@ -2541,8 +2541,13 @@ fn render_markdown(w: &mut fmt::Formatter<'_>,
|
||||||
cx.codes))
|
cx.codes))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn document_short(w: &mut fmt::Formatter<'_>, cx: &Context, item: &clean::Item, link: AssocItemLink<'_>,
|
fn document_short(
|
||||||
prefix: &str, is_hidden: bool) -> fmt::Result {
|
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() {
|
if let Some(s) = item.doc_value() {
|
||||||
let markdown = if s.contains('\n') {
|
let markdown = if s.contains('\n') {
|
||||||
format!("{} [Read more]({})",
|
format!("{} [Read more]({})",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue