Ben Chuanlong Du's Blog

It is never too late to learn.

Modules in Rust

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

In [ ]:
:timing
:sccache 1
  1. A Rust source file should be imported as a module only once in a library or application. The right way to import modules in Rust is to import submodules (if any) in each module file.

  2. You cannot define variables using let in a module. Only static/const variables can be defined in a module.

In [ ]:

In [ ]:

Comments