a-sit-plus / signum

Kotlin Multiplatform Crypto/PKI Library and ASN1 Parser + Encoder
https://a-sit-plus.github.io/signum/
Apache License 2.0
76 stars 6 forks source link

Change return type of `Verifier::verify` from `KmmResult<Unit>` to `KmmResult<Success>` #119

Closed iaik-jheher closed 2 months ago

iaik-jheher commented 2 months ago

Change the return type of Verifier::verify from KmmResult<Unit> to KmmResult<Success>.

This prevents pathological behavior for consumers confusing .map and .transform exhibited here; any scope function can be quietly interpreted as returning Unit by discarding the return value. This is not possible for the unique data object Success.