The snippet library.
Small, practical examples. Search by task or narrow things down below.
Append several values to a vector
Append several values to a vector in a complete Rust program using the standard library.
Rust✓ Tested
Inspect overlapping windows
Inspect overlapping windows in a complete Rust program using the standard library.
Rust✓ Tested
Keep only values satisfying a condition
Keep only values satisfying a condition in a complete Rust program using the standard library.
Rust✓ Tested
Process a slice in bounded chunks
Process a slice in bounded chunks in a complete Rust program using the standard library.
Rust✓ Tested
Remove and collect a vector range
Remove and collect a vector range in a complete Rust program using the standard library.
Rust✓ Tested
Search a sorted slice
Search a sorted slice in a complete Rust program using the standard library.
Rust✓ Tested
Sort a vector in ascending order
Sort a vector in ascending order in a complete Rust program using the standard library.
Rust✓ Tested
Sort and remove repeated values
Sort and remove repeated values in a complete Rust program using the standard library.
Rust✓ Tested
Split a slice into two parts
Split a slice into two parts in a complete Rust program using the standard library.
Rust✓ Tested