Struggling with Rust's module system - is it just me?
As I'm learning Rust, I've found the way modules and code structure work to be a bit strange. In many tutorials, it's often described as being similar to a file system, but I'm having a hard time wrapping my head around the fact that a module isn't defined where its code is located.
I understand the reasoning behind Rust's module system, with the goal of promoting modularity and encapsulation. But in practice, I find it challenging to organize my code in a way that feels natural and intuitive to me.
For example, when I want to create a new module, I often end up spending time thinking about where exactly I should define it, rather than focusing on the implementation. It just doesn't seem to align with how I naturally think about structuring my code.
Is anyone else in the Rust community experiencing similar struggles with the module system? I'd be really interested to hear your thoughts and any tips you might have for getting more comfortable with this aspect of the language.
Any insights or advice would be greatly appreciated as I continue my journey of learning Rust. Thanks in advance!