https://github.com/cryptex-github/deep-flatten
Useful utility for deep flattening nested Options.
https://github.com/cryptex-github/deep-flatten
Last synced: 2 months ago
JSON representation
Useful utility for deep flattening nested Options.
- Host: GitHub
- URL: https://github.com/cryptex-github/deep-flatten
- Owner: Cryptex-github
- License: mit
- Created: 2023-02-15T04:50:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-15T04:52:16.000Z (over 2 years ago)
- Last Synced: 2025-01-23T10:43:32.414Z (4 months ago)
- Language: Rust
- Homepage: https://crates.io/crates/deep-flatten
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deep Flatten
Deep Flatten is a simple utility trait that flattens up to 32 nested Options.
## Example
```rust
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