FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
125 snippets foundClear filters
Use an associated constructor
Use an associated constructor in a complete Rust program using the standard library.
Rust✓ Tested
Use if to produce a value
Use if to produce a value in a complete Rust program using the standard library.
Rust✓ Tested
Wrap a value in a distinct type
Wrap a value in a distinct type in a complete Rust program using the standard library.
Rust✓ Tested
Write and read a UTF-8 file
Write and read a UTF-8 file in a complete Rust program using the standard library.
Rust✓ Tested
Write formatted text into a byte buffer
Write formatted text into a byte buffer in a complete Rust program using the standard library.
Rust✓ Tested