Subject: Re: [PATCH 05/14] rust: add a hash algorithm abstraction

From: Junio C Hamano <[email-masked]>
Date: Wed, 29 Oct 2025 07:32:01 -0700

Junio C Hamano <[email-masked]> writes:

>>> These cases for "None" surprised me a bit; I would have expected us
>>> to error out when given an algorithm we do not recognise.
>>
>> I think _Result_ would be more appropriate here.
>
> Perhaps.  But the Option/Result was not what I was suprised about.
> ...
> Perhaps as_mut_slice() side is justifiable (an uninitialized
> instance of ObjectID is filled by getting the full self.hash and
> filling it, plus filling the algo), but the same explanation would
> not apply on the read-only side.

Rethinking, I guess the "why doesn't it fail in the None case?" is
exactly the same question as "why Option, not Result?" as you
suggested.  Sorry for the noise.