Skip to content

Commit c58f88a

Browse files
authored
README: Fix chained example wrt digest v0.10 (#336)
1 parent e1c2240 commit c58f88a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ println!("Result: {:x}", hash);
9797

9898
In this example `hash` has type `GenericArray<u8, U32>`, which is a generic alternative to `[u8; 32]` defined in the [`generic-array`] crate.
9999

100-
Alternatively, you can use chained approach, which is equivalent to the previous example:
100+
Alternatively, you can use a chained approach, which is equivalent to the previous example:
101101

102102
```rust
103103
use sha2::{Sha256, Digest};
104104

105105
let hash = Sha256::new()
106-
.chain(b"Hello world!")
107-
.chain("String data")
106+
.chain_update(b"Hello world!")
107+
.chain_update("String data")
108108
.finalize();
109109
println!("Result: {:x}", hash);
110110
```

0 commit comments

Comments
 (0)