Crates.io | type-toppings |
lib.rs | type-toppings |
version | 0.1.1 |
source | src |
created_at | 2023-11-08 20:24:47.697658 |
updated_at | 2023-11-14 08:01:42.73915 |
description | Opinionated extensions to standard types |
homepage | |
repository | https://github.com/plul/type-toppings |
max_upload_size | |
id | 1029387 |
size | 30,969 |
Opinionated collection of utility extensions for several of Rust's standard types, including:
Result
Iterator
futures::Steam
https://docs.rs/type-toppings/latest/type_toppings/
use type_toppings::IteratorExt;
// Map only the Some values in an iterator of Option<T>:
let data: Vec<_> = vec![Some(1), None, Some(3)]
.into_iter()
.map_opt(|x| x * 2)
.collect();