Skip to content

Commit

Permalink
der: no-panic cleanup (#1169)
Browse files Browse the repository at this point in the history
Gets rid of an `expect`
  • Loading branch information
tarcieri authored Jul 24, 2023
1 parent f8f2cbd commit 0b60b28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion der/src/asn1/bmp_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]]))
}
}

Expand Down

0 comments on commit 0b60b28

Please sign in to comment.