The sound distributed version control system

#101 pijul/*: reorganize imports and remove extern crate

Closed on November 19, 2020
cole-h on November 19, 2020

I personally find it easier to mentally parse imports when they are separated into blocks of std imports, external crate imports, and internal crate imports.

Additionally, #[macro_use] extern crate is a Rust 2015-ism, and can be replaced by useing the macro (derive or procedural).


This may be too much of a “personal preference” change, but I really think everything looks better like this. If you’re fine with this, I’ll probably go through the other crates in the workspace and do the same.

Btw, maybe now’s the time to remove src/commands/checkout.rs? It’s totally unused, and we have reset --channel. (I didn’t touch it in this change for that reason.)

cole-h added a change on November 19, 2020
L4JXJHWXYNCL4QGJXNKKTOKKTAXKKXBJUUY7HFZGEUZ5A2V5H34QC
main
pmeunier on November 19, 2020

Done, thanks! I guess the next step in that direction is to reorganise the public API in libpijul and libpijul::pristine, but I’ll probably take care of that.

pmeunier closed this discussion on November 19, 2020
cole-h on November 19, 2020

Unrelated, but what were those org id comments you removed in #UBCBQ5FGH2KASHEUPDLIKGLVVX3GSRQ4F4P2JEJZL2NX2DUSYARAC?

pmeunier on November 19, 2020

They come from a time where libpijul was written in literate programming, with math all around the functions. But that proved impractical for debugging and testing, as Rust has no support for mapping lines in generated code to lines in the source. Also, my scripts were depending on an obscure C library, which also made it nontrivial to compile.

cole-h on November 19, 2020

OK, interesting to know. Thanks :)