File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1
- # zips ![ GitHub Actions Workflow Status] ( https://img.shields.io/github/actions/workflow/status/cartercanedy/zips/test.yml?style=for-the-badge&label=tests ) ![ Crates.io Total Downloads] ( https://img.shields.io/crates/d/zips?style=for-the-badge&label=downloads )
1
+ # zips [ ![ GitHub Actions Workflow Status] ( https://img.shields.io/github/actions/workflow/status/cartercanedy/zips/test.yml?style=for-the-badge&label=tests )] ( https://github.com/cartercanedy/zips/actions/workflows/test.yml/ ) [ ![ Crates.io Total Downloads] ( https://img.shields.io/crates/d/zips?style=for-the-badge&label=downloads )] ( https://crates.io/crates/zips )
2
2
Just because I was annoyed that I couldn't use ` Option<T>::zip ` with more than 2 arguments...
3
3
4
4
Zips provides 2 proc-macros that accept any number of either ` Option<T> ` s or ` Result<T, E> ` s as arguments and produces an ` Option<(T [, T...])> ` .
@@ -41,6 +41,8 @@ fn main() -> () {
41
41
// zipped_ok: Option<(i32, usize)>
42
42
let zipped_ok = zip_result! (m , n );
43
43
assert_eq! (zipped_some , Some ((1i32 , 0usize )));
44
+
45
+ let zipped_ok : Result <(i32 , usize ), ()> = Ok (zipped_ok . unwrap ());
44
46
45
47
// zipped_err: Option<((i32, usize), ())>
46
48
let zipped_err = zip_result! (zipped_ok , o );
You can’t perform that action at this time.
0 commit comments