clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

chore: Apply some Clippy lints

Open jbencin opened this issue 7 months ago • 1 comments

Description

Apply some Clippy lints:

Clippy lint Details
bool_to_int_with_if Find and replace if condition { 1 } else { 0 }
manual_assert Replace if condition { panic!() } with assert!()
manual_string_new Replace "".to_string() with String::new()
needless_continue Remove continue statements which have no effect
needless_pass_by_value Pass by reference when appropriate, for example pass &str instead of String

I only partially applied needless_pass_by_value since I didn't want this PR to result in a massive diff. I focused on large objects or functions that were called a lot. I replaced a lot of Strings with &str, which got rid of several unnecessary heap allocations

Breaking change?

No

jbencin avatar Jun 04 '25 16:06 jbencin

Closing for now. For too many conflict and inactivity. We may want to re-assess this PR in a near future

hugoclrd avatar Oct 15 '25 14:10 hugoclrd