@@ -49,7 +49,7 @@ macro_rules! tagged {
49
49
pub struct DataKeyHash ( [ u8 ; 4 ] ) ;
50
50
51
51
impl DataKeyHash {
52
- const fn compute_from_path ( path : & DataKeyPath ) -> Self {
52
+ const fn compute_from_path ( path : DataKeyPath ) -> Self {
53
53
let hash = helpers:: fxhash_32 (
54
54
path. tagged . as_bytes ( ) ,
55
55
leading_tag ! ( ) . len ( ) ,
@@ -59,7 +59,7 @@ impl DataKeyHash {
59
59
}
60
60
61
61
/// Gets the hash value as a byte array.
62
- pub const fn to_bytes ( & self ) -> [ u8 ; 4 ] {
62
+ pub const fn to_bytes ( self ) -> [ u8 ; 4 ] {
63
63
self . 0
64
64
}
65
65
}
@@ -139,7 +139,7 @@ pub struct DataKeyPath {
139
139
impl DataKeyPath {
140
140
/// Gets the path as a static string slice.
141
141
#[ inline]
142
- pub const fn get ( & self ) -> & ' static str {
142
+ pub const fn get ( self ) -> & ' static str {
143
143
/// core::slice::from_raw_parts(a, b) = core::mem::transmute((a, b)) hack
144
144
/// ```compile_fail
145
145
/// const unsafe fn canary() { core::slice::from_raw_parts(0 as *const u8, 0); }
@@ -277,7 +277,7 @@ impl DataKey {
277
277
///
278
278
/// Useful for reading and writing data to a file system.
279
279
#[ inline]
280
- pub const fn path ( & self ) -> DataKeyPath {
280
+ pub const fn path ( self ) -> DataKeyPath {
281
281
self . path
282
282
}
283
283
@@ -297,13 +297,13 @@ impl DataKey {
297
297
/// assert_eq!(KEY_HASH.to_bytes(), [0xe2, 0xb6, 0x17, 0x71]);
298
298
/// ```
299
299
#[ inline]
300
- pub const fn hashed ( & self ) -> DataKeyHash {
300
+ pub const fn hashed ( self ) -> DataKeyHash {
301
301
self . hash
302
302
}
303
303
304
304
/// Gets the metadata associated with this [`DataKey`].
305
305
#[ inline]
306
- pub const fn metadata ( & self ) -> DataKeyMetadata {
306
+ pub const fn metadata ( self ) -> DataKeyMetadata {
307
307
self . metadata
308
308
}
309
309
@@ -328,7 +328,7 @@ impl DataKey {
328
328
pub const fn from_path_and_metadata ( path : DataKeyPath , metadata : DataKeyMetadata ) -> Self {
329
329
Self {
330
330
path,
331
- hash : DataKeyHash :: compute_from_path ( & path) ,
331
+ hash : DataKeyHash :: compute_from_path ( path) ,
332
332
metadata,
333
333
}
334
334
}
@@ -373,7 +373,7 @@ impl DataKey {
373
373
374
374
Ok ( Self {
375
375
path,
376
- hash : DataKeyHash :: compute_from_path ( & path) ,
376
+ hash : DataKeyHash :: compute_from_path ( path) ,
377
377
metadata,
378
378
} )
379
379
}
@@ -453,8 +453,8 @@ impl DataKey {
453
453
/// // The error context contains the argument:
454
454
/// assert_eq!(FOO_BAR.match_key(BAR_BAZ).unwrap_err().key, Some(BAR_BAZ));
455
455
/// ```
456
- pub fn match_key ( & self , key : Self ) -> Result < ( ) , DataError > {
457
- if * self == key {
456
+ pub fn match_key ( self , key : Self ) -> Result < ( ) , DataError > {
457
+ if self == key {
458
458
Ok ( ( ) )
459
459
} else {
460
460
Err ( DataErrorKind :: MissingDataKey . with_key ( key) )
0 commit comments