yamgent blog
I post random writings here.

Latest Posts

Is Structuring a Rust Project As lib.rs + main.rs Hurting Compilation Time?

Are you compiling twice by having a separate lib.rs and main.rs in Rust?

2025-07-26
3 min(s) read

TLDR: It does not.

I am currently doing a personal project in Rust, and by habit, I always separate out a single executable logical unit to library + binary crates.

So for example, a editor.exe would actually be comprised of a editor binary crate and an editorlib library crate.

|-- editor
|    |-- main.rs
|
|-- editorlib
|    |-- lib.rs
|    |-- xx.rs
Read more...

Older posts...