Skip to content

Commit 1d17fc9

Browse files
committed
Apply more fixes provided by clippy 1.80...
...however, leave it at the MSRV as otherwise one would start to use std language features that don't exist yet.
1 parent 7083b7a commit 1d17fc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gix-hash/src/oid.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl oid {
8080
20 => Ok(
8181
#[allow(unsafe_code)]
8282
unsafe {
83-
&*(digest as *const [u8] as *const oid)
83+
&*(std::ptr::from_ref::<[u8]>(digest) as *const oid)
8484
},
8585
),
8686
len => Err(Error::InvalidByteSliceLength(len)),
@@ -97,7 +97,7 @@ impl oid {
9797
pub(crate) fn from_bytes(value: &[u8]) -> &Self {
9898
#[allow(unsafe_code)]
9999
unsafe {
100-
&*(value as *const [u8] as *const oid)
100+
&*(std::ptr::from_ref::<[u8]>(value) as *const oid)
101101
}
102102
}
103103
}

0 commit comments

Comments
 (0)