I want to separate the application logic to keep my main.rs file clean. I am using diesel for a simple project and I have the following files inside /src folder
- main.rs
- lib.rs
- models.rs
- schema.rs
I tried declaring the modules inside main.rs file and using them in the lib.rs file but that produces the following error:
unresolved import
models
; nomodels
external crate [E0432]
main.rs looks like this:
pub mod lib;
pub mod schema;
pub mod models;
lib.rs produces error with this:
pub use models;
pub use schema::sent_sms;
I do not understand why things need to be so awfully complicated in this language, or maybe I am too stupid to understand it. Please help me understand.