vigna / dsi-bitstream-rs

A Rust implementation of read/write bit streams supporting several types of instantaneous codes
Apache License 2.0
7 stars 3 forks source link

feature/clippy clean #4

Closed zacchiro closed 1 year ago

zacchiro commented 1 year ago

This makes the code base "cargo clippy" clean and enable pre-commit check on clippy.

Please review a few things before merging:

Merging this PR would fix #3.

zacchiro commented 1 year ago

On Sun, May 21, 2023 at 10:46:10AM -0700, Sebastiano Vigna wrote:

  • if USE_TABLE {
  • if delta_tables::write_table_be(self, value)? {
  • return Ok(());
  • }
  • if USE_TABLE && delta_tables::write_table_be(self, value)? {

I have a problem here because USE_TABLE is really conditional compilation and mixing it with runtime code is ugly. I like that there is a clear conditional box and inside there's code. I guess there's no way to convince Clippy that a nested if with a constant value is OK, in which case I'd convince Clippy (at least for this crate) that nested if's are OK.

Fair enough. Is it better now with fe6e0177bde269af948073ef781fe88c8fc8baae ?

vigna commented 1 year ago

OMG a bit fine grained but let's go 😂