Skip to content

Commit 264215b

Browse files
authored
Merge pull request #2289 from cruessler/add-non-exhaustive-to-gix-hash-kind
Mark `gix_hash::Kind` as `non_exhaustive`
2 parents eab774c + 9582b17 commit 264215b

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

gix-hash/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const SIZE_OF_SHA1_DIGEST: usize = 20;
5252
/// Denotes the kind of function to produce a [`ObjectId`].
5353
#[derive(Default, PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
5454
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
55+
#[non_exhaustive]
5556
pub enum Kind {
5657
/// The Sha1 hash with 160 bits.
5758
#[default]

gix-worktree-stream/src/protocol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ fn byte_to_mode(b: u8) -> gix_object::tree::EntryMode {
111111
fn hash_to_byte(h: gix_hash::Kind) -> u8 {
112112
match h {
113113
gix_hash::Kind::Sha1 => 0,
114+
_ => unreachable!("BUG: not implemented for hash kind {h}"),
114115
}
115116
}
116117

0 commit comments

Comments
 (0)