I read tons of document but I can't understand this file/module system of Rust. I'm trying to seperate modules but I can't. Because everytime I'm getting error and says:
can't find crate
file not found for module modules
unresolved import crate::modules
file not found for module test1
unresolved import modules
failed to resolve: there are too many initial supers.
unused import: modules::mod
etc.
I have a project that name is "Project1". And this project contains two folder: Src(this folder contains main.rs as you know) and Modules (I created this)
Src folder contains main.rs and Modules folder contains mod.rs, test1.rs, test2.rs.
Now I'm asking you. How I include this "modules" file in the main.rs ? Is this file system really hard to understand or am I only who don't understand this ?
If you have not read this yet, you may want to read it first. If you have already read it and not understand something, ask about the part that you not understand here!
Sorry if my words is not good (English is not my native). But that chapter is written for modules/crate in Rust. If I say something, I just repeat information from it. If you have a code a repo somewhere, then people can point out where is the problem for you.
What is unusual in your setup is that "modules" directory is alongside "src" directory, instead of being inside it. This is the reason why all your attempts failed.
This is solvable by adding #[path = "../modules/mod.rs"] attribute before referencing "modules" module in main.rs.
If I understand correctly your setup is the following: