Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
carter-canedy committed Sep 4, 2024
1 parent 520bfeb commit 1675e64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "zips"
description = "Macros for wrapping up a bunch of Option<T>'s/Result<T, E>'s into a single Option<(T [, T...])>"
version = "0.1.6"
version = "0.1.7"
edition = "2021"
authors = ["Carter Canedy <[email protected]>"]
repository = "https://github.com/cartercanedy/zips"
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $> cargo add zips

### With `Option<T>`:
```rust
use zips::{zip, zip_result};
use zips::zip;

fn main() -> () {
let i: Option<i32> = Some(0);
Expand All @@ -26,10 +26,14 @@ fn main() -> () {
// zipped_none: Option<((i32, usize), ())>
let zipped_none = zip!(zipped_some, k);
assert_eq!(zipped_none, None);
}
```

### With `Result<T, E>`:
```rust
use zips::zip_result;

fn main() -> () {
let m: Result<i32, ()> = Ok(1);
let n: Result<usize, ()> = Ok(0usize);
let o: Result<(), &'static str> = Err("I'm an error!");
Expand Down

0 comments on commit 1675e64

Please sign in to comment.