chore: apply Clippy suggestions and improve code formatting#10691
chore: apply Clippy suggestions and improve code formatting#10691nyurik wants to merge 4 commits intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
7489d4f to
adb143f
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
|
GNU testsuite comparison: |
|
@nyurik I've been fixing some clippy lints, I usually stick to 1 lint per PR for ease of review |
|
GNU testsuite comparison: |
| } | ||
| } | ||
|
|
||
| #[expect(clippy::unnested_or_patterns)] |
There was a problem hiding this comment.
I'll add a comment - but the extended version: this is what it would look like after optimization -- i don't think it's as readable
[b'l' | b'r' | b'e', b'c']
| [b'r', b's']
| [b'n' | b's' | b'd', b'o']
| [b'f' | b'd' | b'p' | b'm', b'i']
| [b'l', b'n']
| [b'b' | b'c', b'd']
| [b'o', b'r' | b'w']
| [b'e', b'x']
| [b's', b'u' | b'g' | b't']
| [b't', b'w']
| [b'c', b'a' | b'l']
| [b'm', b'h']| let mut formatted_possible_values = String::new(); | ||
| for (i, s) in possible_values.iter().enumerate() { | ||
| formatted_possible_values.push_str(&format!("'{}'", s.get_name())); | ||
| let _ = write!(formatted_possible_values, "'{}'", s.get_name()); |
There was a problem hiding this comment.
this is part of the clippy::format_push_string -- clippy warns without this change
|
GNU testsuite comparison: |
clippy::doc_link_with_quotesclippy::flat_map_optionclippy::format_push_stringclippy::from_iter_instead_of_collectclippy::large_types_passed_by_valueclippy::struct_field_namesclippy::unnested_or_patterns