Rollup merge of #116211 - matthiaskrgr:clippy3, r=compiler-errors
more clippy complextity fixes redundant_guards, useless_format, clone_on_copy
This commit is contained in:
commit
fa5b2fe2f5
14 changed files with 19 additions and 24 deletions
|
@ -763,7 +763,7 @@ pub(super) fn filtered_statement_span(statement: &Statement<'_>) -> Option<Span>
|
|||
// and `_1` is the `Place` for `somenum`.
|
||||
//
|
||||
// If and when the Issue is resolved, remove this special case match pattern:
|
||||
StatementKind::FakeRead(box (cause, _)) if cause == FakeReadCause::ForGuardBinding => None,
|
||||
StatementKind::FakeRead(box (FakeReadCause::ForGuardBinding, _)) => None,
|
||||
|
||||
// Retain spans from all other statements
|
||||
StatementKind::FakeRead(box (_, _)) // Not including `ForGuardBinding`
|
||||
|
|
|
@ -54,11 +54,8 @@ impl EnumSizeOpt {
|
|||
let layout = tcx.layout_of(param_env.and(ty)).ok()?;
|
||||
let variants = match &layout.variants {
|
||||
Variants::Single { .. } => return None,
|
||||
Variants::Multiple { tag_encoding, .. }
|
||||
if matches!(tag_encoding, TagEncoding::Niche { .. }) =>
|
||||
{
|
||||
return None;
|
||||
}
|
||||
Variants::Multiple { tag_encoding: TagEncoding::Niche { .. }, .. } => return None,
|
||||
|
||||
Variants::Multiple { variants, .. } if variants.len() <= 1 => return None,
|
||||
Variants::Multiple { variants, .. } => variants,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue