1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-06 14:35:36 +02:00

Add a bit about 'use' (#580)

* Add a bit about 'use'

* fix paths
This commit is contained in:
Dustin J. Mitchell
2023-04-24 14:51:23 -04:00
committed by GitHub
parent 6744822454
commit 69a62ba227
2 changed files with 16 additions and 4 deletions

View File

@ -9,3 +9,11 @@ Paths are resolved as follows:
2. As an absolute path:
* `crate::foo` refers to `foo` in the root of the current crate,
* `bar::foo` refers to `foo` in the `bar` crate.
A module can bring symbols from another module into scope with `use`.
You will typically see something like this at the top of each module:
```rust,editable
use std::collections::HashSet;
use std::mem::transmute;
```