Crates.io | deep-flatten |
lib.rs | deep-flatten |
version | 0.1.0 |
source | src |
created_at | 2023-02-15 04:52:21.768465 |
updated_at | 2023-02-15 04:52:21.768465 |
description | Useful utility for deep flattening nested Options. |
homepage | |
repository | |
max_upload_size | |
id | 785538 |
size | 4,440 |
Deep Flatten is a simple utility trait that flattens up to 32 nested Options.
use deep_flatten::DeepFlatten;
let x = Some(Some(Some(Some(Some(Some(Some(Some(Some(())))))))));
let flattened = x.deep_flatten();
assert_eq!(flattened, Some(()));
Result support coming soon.
I genuinely don't know why you will ever need this but ok