Are you compiling twice by having a separate lib.rs and main.rs in Rust?
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