dropbox / rust-brotli

Brotli compressor and decompressor written in rust that optionally avoids the stdlib
https://dropbox.tech/infrastructure/-broccoli--syncing-faster-by-syncing-less
BSD 3-Clause "New" or "Revised" License
818 stars 83 forks source link

Auto-format `use` statements #180

Closed nyurik closed 5 months ago

nyurik commented 6 months ago

Use nightly fmt to auto-reformat all the use statements. I will create a follow-up PR to do some manual additional cleanups. I did not want to include manual cleanups in the same PR as the initial automatic ones.

Groups use statements into 3 standard groups: std library, 3rd party crates, and brotli crate itself -- StdExternalCrate mode.

Note that the nightly fmt is required for this. It will not affect the regular cargo fmt CI check because regular one ignores use sections (the formatting has not been fully stabilized).

cargo +nightly fmt -- --config imports_granularity=Module,group_imports=StdExternalCrate
cd c && cargo +nightly fmt -- --config imports_granularity=Module,group_imports=StdExternalCrate

Note that the above steps can also be done with just: just fmt2