Skip to content

Commit 87e5343

Browse files
authored
Handle panic when parsing literal (#557)
1 parent 53539e7 commit 87e5343

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/rb-sys-build/src/bindings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<'a> ConfValue<'a> {
241241
Expr::Lit(ExprLit {
242242
lit: Lit::Int(ref lit),
243243
..
244-
}) => lit.base10_parse::<u8>().unwrap() != 0,
244+
}) => lit.base10_parse::<u8>().unwrap_or(1) != 0,
245245
Expr::Lit(ExprLit {
246246
lit: Lit::Bool(ref lit),
247247
..

0 commit comments

Comments
 (0)