diff --git a/Cargo.toml b/Cargo.toml index 11aaf5b..4753689 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ctxerr" -version = "0.2.5" +version = "0.2.6" authors = ["Andrey Tkachenko "] repository = "https://github.com/andreytkachenko/ctxerr.git" keywords = ["error", "handling", "thiserror", "context", "backtrace"] @@ -15,5 +15,5 @@ resolver = "2" members = ["derive"] [dependencies] -ctxerr_derive = {version = "0.5.1", path = "derive"} +ctxerr_derive = {version = "0.5.2", path = "derive"} thiserror = "1.0.40" diff --git a/derive/Cargo.toml b/derive/Cargo.toml index 9cfe162..6907e32 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ctxerr_derive" -version = "0.5.1" +version = "0.5.2" authors = ["Andrey Tkachenko "] repository = "https://github.com/andreytkachenko/ctxerr.git" keywords = ["error", "handling", "thiserror", "context", "backtrace"] diff --git a/derive/src/lib.rs b/derive/src/lib.rs index 1ca7505..1a20554 100644 --- a/derive/src/lib.rs +++ b/derive/src/lib.rs @@ -74,12 +74,12 @@ pub fn ctxerr( } } - impl> From for #base_name { + impl From for #base_name { #[track_caller] - fn from(val: T) -> Self { + fn from(kind: ErrorKind) -> Self { let b = std::backtrace::Backtrace::capture(); Self{ - kind: val.into(), + kind, backtrace: Some(std::backtrace::Backtrace::capture()), location: Some(core::panic::Location::caller()), }