3 ms·
I looked at the Rust documentation's getting started page and it says: > If you’re using more than one word in your filename, use an underscore: hello_world.rs
by criddell 10y ago
I looked at the Rust documentation's getting started page and it says:
> If you’re using more than one word in your filename, use an underscore: hello_world.rs rather than helloworld.rs.
Is the use of underscores a recommendation or a limitation?
- mdzn 10y agoOf course it's just a recommendation. Why would you think otherwise? To Rust, module name is just a bunch of characters, it doesn't recognize words anyhow.
- deleted 10y ago[deleted]
- steveklabnik 10y agoIt's kinda both. Since module names are identifiers, you can't use -s in them. You can still make it work, I believe, with the path attribute, but you'd need to do it on every mod declaration.
- flukus 10y agoIt's a recommendation that you'll find everywhere in rust. By default camelCasing will output compiler warnings. It's my only complaint about the language so far, underscores aren't very typing friendly.