if I create a crate with --lib and decide later on to make it an executable, the only thing I should modify is the lib.rs -> main.rs and everything should be ok ?
Conversely, from exec to lib, main.rs -> lib.rs and the crate is good to go ?
I saw no other difference when I tried. But..
Not that I need it, but I happened to forget to specify --lib in one crate this morning and decided to rm the tree and call the cargo init X --lib. On an empty tree, well, the solution is trivial, but once you add crates, and source, is there a catch to just modify the "entry" file name ?
Please note, I am not talking about the functionality difference between an executable and a lib, just the cargo file structure and management.
(let's not discuss the (in)sanity of not knowing in the first place what your code should be)
Well, binary targets need a fn main(), but otherwise everything should be okay, yes. Note that it is completely fine to have a binary crate (or multiple binary crates) and a library crate in your package, i.e. src/main.rs and src/lib.rs can happily coexist together. If you are curious about Cargo packages and targets, you might want to check out the Cargo book, especially these pages: