From a3a9cd658a60b4ca97eda394de2003f93b41455d Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 24 Jul 2023 14:30:52 -0600 Subject: [PATCH] der: no-panic cleanup Gets rid of an `expect` --- der/src/asn1/bmp_string.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/der/src/asn1/bmp_string.rs b/der/src/asn1/bmp_string.rs index 3ae313931..b4135d518 100644 --- a/der/src/asn1/bmp_string.rs +++ b/der/src/asn1/bmp_string.rs @@ -79,7 +79,7 @@ impl BmpString { // TODO(tarcieri): use `array_chunks` self.as_bytes() .chunks_exact(2) - .map(|chunk| u16::from_be_bytes(chunk.try_into().expect("two bytes"))) + .map(|chunk| u16::from_be_bytes([chunk[0], chunk[1]])) } }