diff --git a/crates/twirp/src/error.rs b/crates/twirp/src/error.rs index 3b22602..7c8ecc1 100644 --- a/crates/twirp/src/error.rs +++ b/crates/twirp/src/error.rs @@ -199,7 +199,7 @@ impl TwirpErrorResponse { &mut self.meta } - pub fn with_meta(mut self, key: S, value: S) -> Self { + pub fn with_meta(mut self, key: S1, value: S2) -> Self { self.meta.insert(key.to_string(), value.to_string()); self } diff --git a/crates/twirp/src/server.rs b/crates/twirp/src/server.rs index eb140b2..ea9ba73 100644 --- a/crates/twirp/src/server.rs +++ b/crates/twirp/src/server.rs @@ -63,7 +63,7 @@ where Ok(tuple) => tuple, Err(err) => { return error::malformed("bad request") - .with_meta("error", &err.to_string()) + .with_meta("error", &err) .with_generic_error(err) .into_response(); } @@ -77,7 +77,7 @@ where Ok(resp) => resp, Err(err) => { return error::internal("error serializing response") - .with_meta("error", &err.to_string()) + .with_meta("error", &err) .with_generic_error(err) .into_response(); }