From b07332308980825ce5ea6d87d21ef11e6baa90e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 20 May 2021 14:04:07 +0200 Subject: [PATCH] qrcode: Add another TryFrom implementation --- matrix_qrcode/src/types.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/matrix_qrcode/src/types.rs b/matrix_qrcode/src/types.rs index efac59f5..38022a5b 100644 --- a/matrix_qrcode/src/types.rs +++ b/matrix_qrcode/src/types.rs @@ -58,6 +58,14 @@ impl TryFrom, Vec>> for QrVerification { } } +impl TryFrom<&[u8]> for QrVerification { + type Error = DecodingError; + + fn try_from(value: &[u8]) -> Result { + Self::from_bytes(value) + } +} + impl TryFrom> for QrVerification { type Error = DecodingError;