fix more clippy::style findings

match_result_ok
obfuscated_if_else
single_char_add
writeln_empty_string
collapsible_match
iter_cloned_collect
unnecessary_mut_passed
This commit is contained in:
Matthias Krüger 2022-12-25 16:42:35 +01:00
parent d9ee0f468f
commit d8874f259a
16 changed files with 73 additions and 92 deletions

View file

@ -2894,7 +2894,7 @@ fn pretty_print_const_value<'tcx>(
if let Some(contents) = tcx.try_destructure_mir_constant(
ty::ParamEnv::reveal_all().and(ConstantKind::Val(ct, ty)),
) {
let fields = contents.fields.iter().copied().collect::<Vec<_>>();
let fields = contents.fields.to_vec();
match *ty.kind() {
ty::Array(..) => {
fmt.write_str("[")?;