-
Error::InvalidDigitis nowError::InvalidCharacter(c)which contains the character that's invalid. -
Invalid checksum errors are now split into
Error::InvalidFinalChecksumandError::InvalidInitialChecksum. -
is_validis now marked with#[must_use]. -
The contents of TurkishId are now completely opaque to be able to keep the possibility to change the internal storage structure in the future. To see its contents, use
to_string()or a formatter.
-
TurkishIdErroris renamed toErrorto conform to Rust semantics. Perhaps, I shouldn't have been so hesitant to make this package 1.0.0, huh :) -
Added
from_seq()method that can generate a valid TurkishId from a given sequence number.
-
Removed
TryFromimpls for&Bytesand&[u8]types. The only conversion is possible from&strnow. Changed the validation to use&strinstead of&[u8]. The main reason I made this change is that it makes no sense to convert from a ASCII-encoded&[u8]not have it as&str. The conversion can alerady be done withfrom_utf8(), no need to repeat it there. -
Removed
Displayimpl fromTurkishIdErrorcompletely as derivingDebugalready does it. This might mean that any code that relies on the fmt output ofTurkishIdErrormight break.
- Fixed build break caused by inline source comments.
- Avoid panic in
Displayimpl completely. The code is completely panic-free now.
- Now works without std (
no_std-enabled), so feel free to use this in your favorite microcontroller :)
- Due to
no_std,Errortrait isn't supported byTurkishIdErroranymore
- Implements
TryFrominstead ofFrom
- Faster validation
First stable release