You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per #507 (comment), I'm going to remove Identity::unwrap_stanza, and make Identity::unwrap_stanzas a required method. The latter will also be documented as always receiving all stanzas from the same file (rather than the current documentation that this is assumed).
The text was updated successfully, but these errors were encountered:
Hmm, after deciding to do this, I took another look at @FiloSottile's age and realised that although its Identity only exposes multi-stanza unwrapping, every single impl uses an internal multiUnwrap helper that does exactly what the default impl of Identity::unwrap_stanzas does:
The Rust impl is significantly cleaner because Rust has Option and can return Option<Result<_, _>>, whereas Go matches on the returned err looking for a sentinel ErrIncorrectIdentity that serves the same role as None in our API.
So, I'm now back on the fence about whether to remove Identity::unwrap_stanza. It's currently the case that Decryptor only ever calls Identity::unwrap_stanzas, so we could just document on Identity that its canonical entry point is Identity::unwrap_stanzas, and then identity impls that want to add file-level stanza checks can do so by overriding the default impl.
Per #507 (comment), I'm going to remove
Identity::unwrap_stanza
, and makeIdentity::unwrap_stanzas
a required method. The latter will also be documented as always receiving all stanzas from the same file (rather than the current documentation that this is assumed).The text was updated successfully, but these errors were encountered: