Skip to content

Commit c28a139

Browse files
committed
Support building multihash with no hashes enabled.
1 parent 498d73e commit c28a139

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

derive/src/multihash.rs

+4
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ pub fn multihash(s: Structure) -> TokenStream {
345345
use #mh_crate::Hasher;
346346
match self {
347347
#(#code_digest,)*
348+
_ => unreachable!(),
348349
}
349350
}
350351

@@ -363,6 +364,7 @@ pub fn multihash(s: Structure) -> TokenStream {
363364
fn from(code: #code_enum) -> Self {
364365
match code {
365366
#(#code_into_u64,)*
367+
_ => unreachable!(),
366368
}
367369
}
368370
}
@@ -417,6 +419,7 @@ mod tests {
417419
let digest = multihash::Strobe256::digest(input);
418420
Multihash::wrap(0x38b64f, &digest.as_ref()).unwrap()
419421
},
422+
_ => unreachable!(),
420423
}
421424
}
422425

@@ -437,6 +440,7 @@ mod tests {
437440
match code {
438441
Code::Identity256 => multihash::IDENTITY,
439442
Code::Strobe256 => 0x38b64f,
443+
_ => unreachable!(),
440444
}
441445
}
442446
}

0 commit comments

Comments
 (0)