Skip to content

Commit 2974d7c

Browse files
nyurikemilio
authored andcommitted
Fix checked_conversions lint
1 parent 2effeef commit 2974d7c

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ cast_possible_truncation = "allow"
5757
cast_possible_wrap = "allow"
5858
cast_precision_loss = "allow"
5959
cast_sign_loss = "allow"
60-
checked_conversions = "allow"
6160
default_trait_access = "allow"
6261
explicit_into_iter_loop = "allow"
6362
flat_map_option = "allow"

bindgen/ir/var.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,7 @@ impl ClangSubItemParser for Var {
234234
assert_eq!(c.len_utf8(), 1);
235235
c as u8
236236
}
237-
CChar::Raw(c) => {
238-
assert!(c <= u64::from(u8::MAX));
239-
c as u8
240-
}
237+
CChar::Raw(c) => u8::try_from(c).unwrap(),
241238
};
242239

243240
(TypeKind::Int(IntKind::U8), VarType::Char(c))

0 commit comments

Comments
 (0)