Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gix-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions gix-worktree-stream/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's too bad that it's not possible to allow the lint, instead of adding a fallback. That way, Gitoxide could opt-in to 'breaking' loudly once a new variant is added.
This makes me feel this non_exhaustive feature is really half-baked… why I can't we opt-out 😅?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It certainly tackles the problem from a specific angle. :-) I find it very useful, but as you say, there’s downsides in a monorepo.

}
}

Expand Down
Loading