I don't know what is so hard in Rust module system? Module is a single rust file, it can only exist within Crate. The latter is basically what other languages call a library, and is what you add to your project. You don't share Rust modules, you share crates. That's it
I was hoping the author would provide a clarifying succinct definition I could use to help new people "get" Rust's module system...
I didn't try to provide an explanation because I wasn't sure I could do any better than what I've seen out there already. If there's interest though, maybe it'd be worth giving it a shot!
I'll ping here if I post something :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I don't know what is so hard in Rust module system? Module is a single rust file, it can only exist within Crate. The latter is basically what other languages call a library, and is what you add to your project. You don't share Rust modules, you share crates. That's it
Unfortunately it's not quite so straightforward:
Take for example a file foo.rs:
Above, you have
foo.rs
defining a foo module AND a bar module--all within 1 file. The author is right, it is confusing for people to pick up.I was hoping the author would provide a clarifying succinct definition I could use to help new people "get" Rust's module system...
I didn't try to provide an explanation because I wasn't sure I could do any better than what I've seen out there already. If there's interest though, maybe it'd be worth giving it a shot!
I'll ping here if I post something :)