colored-rs / colored

(Rust) Coloring terminal so simple you already know how to do it !
Mozilla Public License 2.0
1.74k stars 84 forks source link

Clippy lints, fix deprecation warnings #179

Closed atezet closed 1 month ago

atezet commented 1 month ago

Went ahead and fixed some clippy lints and deprecation warnings. Might break backwards compatibility, so maybe merge this before bumping the version to 3.0

spenserblack commented 1 month ago

@atezet All of the changes in https://github.com/colored-rs/colored/pull/179/commits/cee0316ae14a7fbf6bc96bad45a26ff41d05f67a were generated with cargo clippy --fix, right?

spenserblack commented 1 month ago

Oops, only squash and rebase merging are enabled in this repo, so I can't add https://github.com/colored-rs/colored/commit/47448381b7045cba5f7703745b3ef1a5eade9ed0 to this PR. Nevermind.

atezet commented 1 month ago

I've added some pedantic rules that I use across my projects. The following are configured in my editor:

clippy::cloned_instead_of_copied
clippy::expl_impl_clone_on_copy
clippy::explicit_deref_method
clippy::needless_pass_by_value
clippy::no_effect_underscore_binding
clippy::redundant_allocation
clippy::semicolon_if_nothing_returned
clippy::trivially_copy_pass_by_ref
clippy::unnecessary_wraps
clippy::unused_async
clippy::unused_self
clippy::wildcard_imports