Merge branch 'cleanup/duplicated-code' of https://github.com/laesse/bool-toggle into cleanup/duplicated-code

This commit is contained in:
Laesse 2024-02-13 08:13:56 +01:00
commit a0fc2b497a
No known key found for this signature in database
GPG key ID: 1A8EEF88F7CA7262
2 changed files with 3 additions and 4 deletions

View file

@ -25,7 +25,7 @@ For license inquiries, send mail to `/dev/null`.
## Architecture ## Architecture
Tis Crate features the world's most resilient bit filping algorithm. It's code adheres to the highest clean code standards This Crate features the world's most resilient bit flipping algorithm. Its code adheres to the highest clean code standards
and aims to provide a maintainable and future proof solution to all the boolean toggling needs there are. and aims to provide a maintainable and future proof solution to all the boolean toggling needs there are.
## MSRV ## MSRV

View file

@ -21,8 +21,7 @@ pub use TogglingIsALifestyle as IAmTheToggler;
impl TogglingIsALifestyle for bool { impl TogglingIsALifestyle for bool {
fn toggle(&mut self) { fn toggle(&mut self) {
// i am so smart // i am so smart
let mut bool_toggler = BooleanTogglerFactory::create_boolean_toggler(self); BooleanTogglerFactory::create_boolean_toggler(self).toggle();
bool_toggler.toggle();
} }
} }
@ -31,7 +30,7 @@ impl<const N: usize> TogglingIsALifestyle for [bool; N] {
fn toggle(&mut self) { fn toggle(&mut self) {
// i am so fast // i am so fast
for b in self { for b in self {
let mut bool_toggler = BooleanTogglerFactory::create_boolean_toggler(self); let mut bool_toggler = BooleanTogglerFactory::create_boolean_toggler(b);
bool_toggler.toggle(); bool_toggler.toggle();
} }
} }