There are a few I'm aware of:

  1. Rust-style use (multiple imports per statement, renaming items using as)
  2. Java-style import (single import per statement, no renaming (afaik))
  3. Zig-style let xlib = @import("xlib") (imports as assignments)
  4. C-style #include (no importing, just pastes the code of the named file)
you are viewing a single comment's thread
view the rest of the comments
[–] [S] 4 points 23 hours ago (1 child)

use imports things (items, crates, modules), while mod defines a module (either in another file with a a semicolon or in the same file with curly braces)

  • source
  • parent
  • hideshow 1 child comment