fix(Runtime): lune exit codes are u8

See 82c8b902e0.
This commit is contained in:
Erica Marigold 2024-04-12 21:47:47 +05:30
parent 13198e1851
commit e7cbd93b40
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1
5 changed files with 21 additions and 22 deletions

34
Cargo.lock generated
View file

@ -106,9 +106,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.81"
version = "1.0.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519"
[[package]]
name = "arrayref"
@ -188,9 +188,9 @@ checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799"
[[package]]
name = "async-trait"
version = "0.1.79"
version = "0.1.80"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681"
checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [
"proc-macro2",
"quote",
@ -675,9 +675,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
[[package]]
name = "encoding_rs"
version = "0.8.33"
version = "0.8.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1"
checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59"
dependencies = [
"cfg-if",
]
@ -1489,7 +1489,7 @@ dependencies = [
[[package]]
name = "mlua-luau-scheduler"
version = "0.0.2"
source = "git+https://github.com/0x5eal/mlua-luau-scheduler-exitstatus.git#22d15b36499db93c46ec381a562a3d1f440d6d02"
source = "git+https://github.com/0x5eal/mlua-luau-scheduler-exitstatus.git#82c8b902e09a21a9befa4e037beadefbe2360b7f"
dependencies = [
"async-executor",
"blocking",
@ -1737,7 +1737,7 @@ dependencies = [
"line-wrap",
"quick-xml",
"serde",
"time 0.3.34",
"time 0.3.36",
]
[[package]]
@ -1797,9 +1797,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.35"
version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [
"proc-macro2",
]
@ -2627,9 +2627,9 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.34"
version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [
"deranged",
"itoa",
@ -2637,7 +2637,7 @@ dependencies = [
"powerfmt",
"serde",
"time-core",
"time-macros 0.2.17",
"time-macros 0.2.18",
]
[[package]]
@ -2658,9 +2658,9 @@ dependencies = [
[[package]]
name = "time-macros"
version = "0.2.17"
version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
dependencies = [
"num-conv",
"time-core",
@ -3326,9 +3326,9 @@ checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
[[package]]
name = "winnow"
version = "0.6.5"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8"
checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352"
dependencies = [
"memchr",
]

View file

@ -49,7 +49,7 @@ impl RunCommand {
eprintln!("{err}");
ExitCode::FAILURE
}
Ok((code, _)) => code,
Ok((code, _)) => ExitCode::from(code),
})
}
}

View file

@ -1,5 +1,4 @@
use std::{
process::ExitCode,
rc::Rc,
sync::{
atomic::{AtomicBool, Ordering},
@ -64,7 +63,7 @@ impl Runtime {
&mut self,
script_name: impl AsRef<str>,
script_contents: impl AsRef<[u8]>,
) -> Result<(i32, Vec<Value>), RuntimeError> {
) -> Result<(u8, Vec<Value>), RuntimeError> {
// Create a new scheduler for this run
let sched = Scheduler::new(&self.lua);

View file

@ -37,6 +37,6 @@ pub async fn run(patched_bin: impl AsRef<[u8]>) -> Result<ExitCode> {
eprintln!("{err}");
ExitCode::FAILURE
}
Ok((code, _)) => code,
Ok((code, _)) => ExitCode::from(code),
})
}

View file

@ -32,7 +32,7 @@ macro_rules! create_tests {
.trim_end_matches(".lua")
.to_string();
let (exit_code, _) = lune.run(&script_name, &script).await?;
Ok(exit_code)
Ok(ExitCode::from(exit_code as u8))
}
)* }
}