Skip to content

Commit 64b6039

Browse files
committed
Add as_slice to Checksum
1 parent fc2d733 commit 64b6039

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/std/src/checksum.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ impl Checksum {
3535
pub fn to_hex(self) -> String {
3636
self.to_string()
3737
}
38+
39+
/// Returns a reference to the inner bytes of this checksum as a slice.
40+
/// If you need a reference to the array, use [`AsRef::as_ref`].
41+
pub fn as_slice(&self) -> &[u8] {
42+
&self.0
43+
}
3844
}
3945

4046
impl fmt::Display for Checksum {

0 commit comments

Comments
 (0)