From a2291b9f751abb7b0412085aa724af06849604cf Mon Sep 17 00:00:00 2001 From: Nodrance <94304824+Nodrance@users.noreply.github.com> Date: Thu, 23 Jul 2026 16:19:59 -0230 Subject: [PATCH] Fix generic error access issue --- src/public.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/public.rs b/src/public.rs index b5d1a03..298b38e 100644 --- a/src/public.rs +++ b/src/public.rs @@ -463,18 +463,20 @@ impl std::fmt::Display for KeybdKey { #[derive(Debug, Error)] pub enum ParseError { #[error("Unable to parse the keycode value")] - ParseIntError { - #[from] - source: std::num::ParseIntError, - backtrace: std::backtrace::Backtrace, - }, + ParseIntError, #[error("Unknown format '{val}'")] UnknownFormat { val: String, - backtrace: std::backtrace::Backtrace, }, } +#[cfg(feature = "serde")] +impl From for ParseError { + fn from(_: std::num::ParseIntError) -> Self { + return ParseError::ParseIntError + } +} + #[cfg(feature = "serde")] impl std::str::FromStr for KeybdKey { type Err = ParseError; @@ -498,8 +500,7 @@ impl std::str::FromStr for KeybdKey { } Err(ParseError::UnknownFormat { - val: s.to_string(), - backtrace: std::backtrace::Backtrace::capture(), + val: s.to_string() }) } } @@ -622,8 +623,7 @@ impl std::str::FromStr for MouseButton { } Err(ParseError::UnknownFormat { - val: s.to_string(), - backtrace: std::backtrace::Backtrace::capture(), + val: s.to_string() }) } }