Introduction
In this lab, we will explore the use
declaration in Rust, which allows us to bind a full path to a new name for easier access, and can be used with the as
keyword to bind imports to a different name. Example code snippets demonstrate how to use the use
declaration to simplify accessing functions and modules within nested paths.
Note: If the lab does not specify a file name, you can use any file name you want. For example, you can use
main.rs
, compile and run it withrustc main.rs && ./main
.