diff --git a/Cargo.lock b/Cargo.lock index 3b847f64..c90b0025 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4241,7 +4241,7 @@ dependencies = [ [[package]] name = "playdate-sys" -version = "0.4.2" +version = "0.4.3" dependencies = [ "arrayvec", "playdate-bindgen", diff --git a/api/sys/Cargo.toml b/api/sys/Cargo.toml index 8cb37a95..22c60c60 100644 --- a/api/sys/Cargo.toml +++ b/api/sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "playdate-sys" -version = "0.4.2" +version = "0.4.3" build = "src/build.rs" readme = "README.md" description = "Low-level Playdate API bindings" diff --git a/api/sys/README.md b/api/sys/README.md index 3c2f3126..f1dd194a 100644 --- a/api/sys/README.md +++ b/api/sys/README.md @@ -23,6 +23,8 @@ _I've experimented enough with wrapping the entire API with results at every ste ## Prerequisites +MNRV is [`1.81.0` from 2024-06-29][rust-toolchain.toml] + 1. Rust __nightly__ toolchain (rustup is optional) 1. [Playdate SDK][sdk] - Ensure that env var `PLAYDATE_SDK_PATH` points to the SDK root @@ -31,6 +33,7 @@ _I've experimented enough with wrapping the entire API with results at every ste [sdk]: https://play.date/dev/#cardSDK [doc-prerequisites]: https://sdk.play.date/Inside%20Playdate%20with%20C.html#_prerequisites +[rust-toolchain.toml]: https://github.com/boozook/playdate/blob/main/rust-toolchain.toml#L2 ## Usage diff --git a/api/sys/src/sys/panic.rs b/api/sys/src/sys/panic.rs index 239e08ac..930c2f34 100644 --- a/api/sys/src/sys/panic.rs +++ b/api/sys/src/sys/panic.rs @@ -11,23 +11,6 @@ use super::proc::error; #[panic_handler] fn panic(panic_info: &PanicInfo) -> ! { let mut output = ArrayString::<1024>::new(); - let payload = if let Some(payload) = panic_info.payload().downcast_ref::<&str>() { - payload - } else { - "" - }; - - let location = panic_info.location(); - let (module, line) = if let Some(location) = location { - (location.file(), location.line()) - } else { - ("", 0) - }; - - let _ = if let Some(message) = panic_info.message() { - write!(output, "PANIC: [{module}@{line}] \"{message}\" {payload}\0") - } else { - write!(output, "PANIC: [{module}@{line}] {payload}\0") - }; + let _ = write!(output, "{panic_info}\0"); error(output.as_str()); }