Hello, I am quite new to Rust, who is reading the Rust Programming Book!
I got curious what is the difference between
cargo new --lib and
cargo new --bin.
More specifically, if once I create a new package using
cargo new --bin and later decided to add
src/lib.rs, I was not able to import contents in
extern crate <package name>.
However, the opposite way works very well.
What is the key difference that those packages created from
--lib flag and
--bin flag behave differently?