We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45fcb26 commit 7c5d781Copy full SHA for 7c5d781
src/conversion.rs
@@ -671,7 +671,7 @@ impl FromLua for char {
671
match value {
672
// When integer: reduce it to u8 and try to convert to char
673
Value::Integer(i) => {
674
- if i <= u8::MAX.into() {
+ if i <= u8::MAX.into() && i >= 0 {
675
Ok(char::from(i as u8))
676
} else {
677
Err(Error::FromLuaConversionError {
0 commit comments