News for hackers. Stuff that matters.
Re:Learning Rust – Day 4 – Understanding Modules by bobbylarrybobby on Thursday May 12, 2022 @02:40PM (#31358374)
Rust has two distinct semantics surrounding how items can be "in scope".

First, the `mod` keyword takes a module that the current file/scope can see and makes it available within that file/scope as if it had been defined there. This is necessary to make the module's items accessible, i.e., specifiable by their path within the module, in the current file/scope.

Then the `use` keyword takes an already-accessible member of a named scope -- a module, a type, etc -- and makes it usable by name (i.e., without scoping on each use) in the current scope.

There are no comments on this comment yet.