Skip to content

Commit 1d5f4bd

Browse files
committed
Avoid using as to convert u8 to usize.
Enable the clippy lint for this.
1 parent 0789a90 commit 1d5f4bd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#![doc(html_root_url = "https://briansmith.org/rustdoc/")]
2828
#![cfg_attr(not(feature = "std"), no_std)]
2929
#![allow(clippy::single_match)]
30+
#![deny(clippy::as_conversions)]
3031

3132
#[cfg(any(test, feature = "alloc"))]
3233
#[cfg_attr(test, macro_use)]

src/verify_cert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ fn check_basic_constraints(
232232
// certificates have pathLenConstraint.
233233
let path_len_constraint = if !input.at_end() {
234234
let value = der::small_nonnegative_integer(input)?;
235-
Some(value as usize)
235+
Some(usize::from(value))
236236
} else {
237237
None
238238
};

0 commit comments

Comments
 (0)