November 2017
Intermediate to advanced
264 pages
5h 45m
English
In previous chapters, we used built-in modules such as str, vec, and io from the std crate. The std crate contains many modules and functions that are used in real projects. For that reason, you won't see extern crate std, because std is imported by default in every other crate.
The small prelude module in std declares mostly traits (such as Copy, Send, Sync, Drop, Clone, Eq, Ord, and so on) and common types (such as Option and Result). For the same reason, the contents of the prelude module are imported by default in every module, as well as a number of standard macros (such as println!). That is the reason why we don't need to specify Result:: before the Ok and Err variants in match branches.
The website ...
Read now
Unlock full access