Rust modules: Difference between revisions

From wikinotes
(Created page with "Modules are rust libraries. <syntaxhighlight lang="rust"> use std::io; // imports a module </syntaxhighlight>")
 
No edit summary
Line 1: Line 1:
Modules are rust libraries.
Modules are rust libraries.<br>
The <code>std::prelude</code> module is included in the scope of every program.


<syntaxhighlight lang="rust">
<syntaxhighlight lang="rust">
use std::io;  // imports a module
use std::io;  // imports a module
</syntaxhighlight>
</syntaxhighlight>

Revision as of 21:58, 6 February 2023

Modules are rust libraries.
The std::prelude module is included in the scope of every program.

use std::io;   // imports a module