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
It's unclear if having separate DecimalError, KeyError, TokenError, StringError, and OutOfRangeError types is actually useful. All of these correspond to cases in which data is being converted into an sfv type, the majority of which will occur during serialization, which is already fallible for lists and dictionaries, which return sfv::Error to indicate this.
Having a common error type (i.e. using sfv::Error for all of these) makes it a bit easier to propagate them without falling back to Box<dyn std::error::Error> or a user-defined enum.
It's unclear if having separate
DecimalError
,KeyError
,TokenError
,StringError
, andOutOfRangeError
types is actually useful. All of these correspond to cases in which data is being converted into ansfv
type, the majority of which will occur during serialization, which is already fallible for lists and dictionaries, which returnsfv::Error
to indicate this.Having a common error type (i.e. using
sfv::Error
for all of these) makes it a bit easier to propagate them without falling back toBox<dyn std::error::Error>
or a user-definedenum
.See https://docs.rs/jiff/latest/jiff/struct.Error.html#design for related discussion of this pattern.
The text was updated successfully, but these errors were encountered: