How to refer to lib.rs adjacent to main.rs without knowing crate name?

I expect the answer is: "You can't get there from here", but I will ask anyway.

I have a project that I just refactored into main.rs and lib.rs (following the outline in the book). I'm not wild about the project name, so I just picked something random ("clist") when I first created it. I expect it will change as my project matures.

The problem is, when the project does mature, I will have to change the name in (at least) two places: Cargo.toml and main.rs (plus any other binaries I place adjacent to main.rs).

Is there some way in main.rs to refer to the modules defined in lib.rs without knowing the name of the crate defined in Cargo.toml? I tried crate::, super::, super::lib::, etc... and nothing seemed to work.

As I said, I expect the answer will be "You can't get there from here", and I'll just refer to the library by the random name I stuck in the Cargo.toml file.

--wpd

You can add a re-export in your main.rs file.

pub use your_crate_name as some_other_name;

Thank you Alice... I guess my question/point is that, if I change the name of the package in Cargo.toml, I will have to make a corresponding change in main.rs (and any parallel bin crates).

--wpd

Yes, you will. However anything that accesses it using the re-export wont have to be changed as long as you use the reexport.