Skip to content

Commit 8f41559

Browse files
authored
Rollup merge of #92868 - pierwill:librustdoc-clippy, r=camelid
librustdoc: Address some clippy lints
2 parents c693442 + 7e055c6 commit 8f41559

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

src/librustdoc/html/render/mod.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1191,11 +1191,9 @@ fn render_deref_methods(
11911191
}
11921192
}
11931193
render_assoc_items_inner(w, cx, container_item, did, what, derefs);
1194-
} else {
1195-
if let Some(prim) = target.primitive_type() {
1196-
if let Some(&did) = cache.primitive_locations.get(&prim) {
1197-
render_assoc_items_inner(w, cx, container_item, did, what, derefs);
1198-
}
1194+
} else if let Some(prim) = target.primitive_type() {
1195+
if let Some(&did) = cache.primitive_locations.get(&prim) {
1196+
render_assoc_items_inner(w, cx, container_item, did, what, derefs);
11991197
}
12001198
}
12011199
}

src/librustdoc/html/render/print_item.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ pub(super) fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer,
129129
};
130130

131131
let item_vars = ItemVars {
132-
page: page,
132+
page,
133133
static_root_path: page.get_static_root_path(),
134-
typ: typ,
134+
typ,
135135
name: item.name.as_ref().unwrap().as_str(),
136136
item_type: &item.type_().to_string(),
137-
path_components: path_components,
137+
path_components,
138138
stability_since_raw: &stability_since_raw,
139139
src_href: src_href.as_deref(),
140140
};

src/librustdoc/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#![feature(iter_intersperse)]
1919
#![recursion_limit = "256"]
2020
#![warn(rustc::internal)]
21+
#![allow(clippy::collapsible_if, clippy::collapsible_else_if)]
2122

2223
#[macro_use]
2324
extern crate tracing;

src/librustdoc/passes/stripper.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ impl<'a> DocFolder for Stripper<'a> {
4343
| clean::TraitAliasItem(..)
4444
| clean::MacroItem(..)
4545
| clean::ForeignTypeItem => {
46-
if i.def_id.is_local() {
47-
if !self.access_levels.is_exported(i.def_id.expect_def_id()) {
48-
debug!("Stripper: stripping {:?} {:?}", i.type_(), i.name);
49-
return None;
50-
}
46+
if i.def_id.is_local() && !self.access_levels.is_exported(i.def_id.expect_def_id())
47+
{
48+
debug!("Stripper: stripping {:?} {:?}", i.type_(), i.name);
49+
return None;
5150
}
5251
}
5352

0 commit comments

Comments
 (0)