Skip to content

Commit

Permalink
der: no-panic cleanup
Browse files Browse the repository at this point in the history
Gets rid of an `expect`
  • Loading branch information
tarcieri committed Jul 24, 2023
1 parent f8f2cbd commit a3a9cd6
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 a3a9cd6

Please sign in to comment.