qrcode: Add another TryFrom implementation

master
Damir Jelić 2021-05-20 14:04:07 +02:00
parent 305766955b
commit b073323089
1 changed files with 8 additions and 0 deletions

View File

@ -58,6 +58,14 @@ impl TryFrom<ImageBuffer<Luma<u8>, Vec<u8>>> for QrVerification {
} }
} }
impl TryFrom<&[u8]> for QrVerification {
type Error = DecodingError;
fn try_from(value: &[u8]) -> Result<Self, Self::Error> {
Self::from_bytes(value)
}
}
impl TryFrom<Vec<u8>> for QrVerification { impl TryFrom<Vec<u8>> for QrVerification {
type Error = DecodingError; type Error = DecodingError;