Fix tidy check errors

This commit is contained in:
Hirokazu Hata 2019-02-23 17:02:57 +09:00
parent 1932d7a52d
commit 1fe87df104
4 changed files with 45 additions and 10 deletions

View File

@ -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(|| {

View File

@ -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 {

View File

@ -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

View File

@ -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]({})",