3 ms·
When you write 'mod foo;' in a Rust file (say, main.rs), Rust will look for the source code for the module named foo in one of two places: a file named foo.rs i
by jeswin 1y ago
When you write 'mod foo;' in a Rust file (say, main.rs), Rust will look for the source code for the module named foo in one of two places: a file named foo.rs in the same directory as the file declaring the module, or a folder named foo/ with a file named mod.rs inside it.
That's great. Something like this is what C# can also aim for, while retaining full backward compatibility.
- metaltyphoon 1y agoThis would break every codebase in C# where a file lives in a folder where it is NOT in sync with the file system.
- jeswin 1y agoThis can be opt in, and not break any existing code.