From: brian m. carlson Date: Wed, 29 Oct 2025 00:36:52 GMT Subject: Re: [PATCH 04/14] rust: add a ObjectID struct Message-ID: In-Reply-To: On 2025-10-28 at 09:17:03, Patrick Steinhardt wrote: > We typically don't have these headers for our C code, so why have it > over here? This is explained in the cover letter. > An alternative to represent this type would be to use an enum: > > pub enum ObjectID { > SHA1([u8; GIT_SHA1_RAWSZ]), > SHA256([u8; GIT_SHA256_RAWSZ]), > } > > That would give us some type safety going forward, but it might be > harder to work with for us? I agree that would be a nicer end state, but that can't be cast from C, which we do later in the series. The goal is to have a type that is suitable for FFI between C and Rust and we will be able to switch once we have no more C code using this type. -- brian m. carlson (they/them) Toronto, Ontario, CA