Wednesday, August 31, 2022

Solution to Rust pop-quiz 3: modules

Solution to Rust pop-quiz 3, modules: utils.rs winter.rs

Q. There's no `mod` at the top of utils.rs. How does Rust know what module it is?
A. The filename, and the directive `mod utils;` in winter.rs tells Rust which module to import.

No comments:

Post a Comment