diff --git a/gix-hash/src/lib.rs b/gix-hash/src/lib.rs index a758fb10a5f..02e7bc2420c 100644 --- a/gix-hash/src/lib.rs +++ b/gix-hash/src/lib.rs @@ -52,6 +52,7 @@ const SIZE_OF_SHA1_DIGEST: usize = 20; /// Denotes the kind of function to produce a [`ObjectId`]. #[derive(Default, PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[non_exhaustive] pub enum Kind { /// The Sha1 hash with 160 bits. #[default] diff --git a/gix-worktree-stream/src/protocol.rs b/gix-worktree-stream/src/protocol.rs index 49074f22df0..7e8e1f8b44c 100644 --- a/gix-worktree-stream/src/protocol.rs +++ b/gix-worktree-stream/src/protocol.rs @@ -111,6 +111,7 @@ fn byte_to_mode(b: u8) -> gix_object::tree::EntryMode { fn hash_to_byte(h: gix_hash::Kind) -> u8 { match h { gix_hash::Kind::Sha1 => 0, + _ => unreachable!("BUG: not implemented for hash kind {h}"), } }