Skip to content

Commit 482a7b1

Browse files
committed
Bump to rust 1.91, use payload_as_str
1 parent 0bffbb4 commit 482a7b1

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2024"
1010
license = "MIT"
1111
publish = false
1212
repository = "https://github.com/ictrobot/aoc-rs"
13-
rust-version = "1.90.0"
13+
rust-version = "1.91.0"
1414

1515
[workspace.lints.clippy]
1616
pedantic = { level = "warn", priority = -1 }

crates/aoc_wasm/src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ extern "C" fn run_puzzle(
3030
) -> bool {
3131
ONCE_PANIC_HANDLER.call_once(|| {
3232
std::panic::set_hook(Box::new(|info| {
33-
let payload = info.payload();
34-
let error: &str = if let Some(s) = payload.downcast_ref::<&str>() {
35-
s
36-
} else if let Some(s) = payload.downcast_ref::<String>() {
37-
s
38-
} else {
33+
let Some(error) = info.payload_as_str() else {
3934
return;
4035
};
4136

0 commit comments

Comments
 (0)