Content deleted Content added
start unsafe section |
minor c/e, slight promotional tone |
||
Line 453:
==== Standard library ====
The Rust [[standard library]] defines and implements many widely used custom data types, including core data structures such as {{code|Vec}}, {{code|Option}}, and {{code|HashMap}}, as well as [[smart pointer]] types. Rust also provides a way to exclude most of the standard library using the attribute {{rust|#![no_std]}}
Rust uses [[Option type|<code>Option</code>]] to define optional values, which can be matched using <code>if let</code> or <code>match</code> to access the inner value:{{sfn|Klabnik|Nichols|2023|pp=108-110,113-114,116-117}}
Line 482:
=== Polymorphism ===
Rust
<syntaxhighlight lang="rust">
Line 504:
</syntaxhighlight>
The example above also includes a method {{code|is_zero}} which provides a default implementation
A function can then be made generic
<syntaxhighlight lang="rust">
|