Hacker News new | ask | show | jobs
by loeg 86 days ago
Isn't creating a bunch of crates pretty annoying, logistically (in terms of mandatory directory structure and metadata files per crate)? (Compared with C/C++ individual .c/.cpp files being compilation units.) And does parallel compilation of crates break LTO?
1 comments

Not particularly annoying. You type `cargo new [options] <path>`, probably with the `--lib` option for a library crate, and it makes a new crate at <path>. Then you open the created lib.rs & cargo.toml in your editor & start writing code.
You end up with at least one extra level of directory nesting, and you have to manage a Cargo.toml for each crate?