I ran cargo clippy and addressed some issues it raised, while leaving other issues for another time. Hopefully this will make this code a bit easier for newcomers to read.
Biggest changes:
foo.len() > 0 ➡ !foo.is_empty()
return x; ➡ x
{ foo: foo } ➡ { foo }
adding a few Default trait implementations
some match statement cleanup
Also, fixed two ffi::uInt::max_value() ➡ ffi::uInt::MAX due to deprecation.
Biggest TODOs (please give feedback if they should be fixed too):
Clippy has complained about many foo >> 0 -- which is a noop that might confuse (?)
some other corner cases that I don't know enough about
I ran
cargo clippy
and addressed some issues it raised, while leaving other issues for another time. Hopefully this will make this code a bit easier for newcomers to read.Biggest changes:
foo.len() > 0
➡!foo.is_empty()
return x;
➡x
{ foo: foo }
➡{ foo }
Default
trait implementationsmatch
statement cleanupAlso, fixed two
ffi::uInt::max_value()
➡ffi::uInt::MAX
due to deprecation.Biggest TODOs (please give feedback if they should be fixed too):
foo >> 0
-- which is a noop that might confuse (?)