Skip to content

Commit 62d5562

Browse files
Fix clippy lints
1 parent c074d8e commit 62d5562

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: src/librustdoc/clean/cfg.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ impl Cfg {
9090
},
9191
MetaItemKind::List(ref items) => {
9292
let orig_len = items.len();
93-
let sub_cfgs =
93+
let mut sub_cfgs =
9494
items.iter().filter_map(|i| Cfg::parse_nested(i, exclude).transpose());
9595
let ret = match name {
96-
sym::all => sub_cfgs.fold(Ok(Cfg::True), |x, y| Ok(x? & y?)),
97-
sym::any => sub_cfgs.fold(Ok(Cfg::False), |x, y| Ok(x? | y?)),
96+
sym::all => sub_cfgs.try_fold(Cfg::True, |x, y| Ok(x & y?)),
97+
sym::any => sub_cfgs.try_fold(Cfg::False, |x, y| Ok(x | y?)),
9898
sym::not => {
9999
if orig_len == 1 {
100100
let mut sub_cfgs = sub_cfgs.collect::<Vec<_>>();

Diff for: src/librustdoc/clean/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub(crate) fn name_from_pat(p: &hir::Pat<'_>) -> Symbol {
320320
);
321321
return Symbol::intern("()");
322322
}
323-
PatKind::Guard(p, _) => return name_from_pat(&*p),
323+
PatKind::Guard(p, _) => return name_from_pat(p),
324324
PatKind::Range(..) => return kw::Underscore,
325325
PatKind::Slice(begin, ref mid, end) => {
326326
let begin = begin.iter().map(|p| name_from_pat(p).to_string());

0 commit comments

Comments
 (0)