Skip to content

Commit

Permalink
Rollup merge of #135505 - GuillaumeGomez:clippy, r=notriddle
Browse files Browse the repository at this point in the history
Fix clippy lints in rustdoc

Some more clippy lint fixes.

r? `@notriddle`
  • Loading branch information
workingjubilee authored Jan 15, 2025
2 parents b52f2fa + 62d5562 commit 4f25a31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/librustdoc/clean/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ impl Cfg {
},
MetaItemKind::List(ref items) => {
let orig_len = items.len();
let sub_cfgs =
let mut sub_cfgs =
items.iter().filter_map(|i| Cfg::parse_nested(i, exclude).transpose());
let ret = match name {
sym::all => sub_cfgs.fold(Ok(Cfg::True), |x, y| Ok(x? & y?)),
sym::any => sub_cfgs.fold(Ok(Cfg::False), |x, y| Ok(x? | y?)),
sym::all => sub_cfgs.try_fold(Cfg::True, |x, y| Ok(x & y?)),
sym::any => sub_cfgs.try_fold(Cfg::False, |x, y| Ok(x | y?)),
sym::not => {
if orig_len == 1 {
let mut sub_cfgs = sub_cfgs.collect::<Vec<_>>();
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ pub(crate) fn name_from_pat(p: &hir::Pat<'_>) -> Symbol {
);
return Symbol::intern("()");
}
PatKind::Guard(p, _) => return name_from_pat(&*p),
PatKind::Guard(p, _) => return name_from_pat(p),
PatKind::Range(..) => return kw::Underscore,
PatKind::Slice(begin, ref mid, end) => {
let begin = begin.iter().map(|p| name_from_pat(p).to_string());
Expand Down

0 comments on commit 4f25a31

Please sign in to comment.