From 85e31f3d42ff764779a68eccfda2126f5982f5c3 Mon Sep 17 00:00:00 2001 From: Vegard Sandengen Date: Thu, 25 Apr 2024 08:00:54 +0000 Subject: [PATCH] feat(extract::Path): change format of `value` in ErrorKind to non-Debug --- axum/src/extract/path/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/axum/src/extract/path/mod.rs b/axum/src/extract/path/mod.rs index ec8577e345..1c074c1cac 100644 --- a/axum/src/extract/path/mod.rs +++ b/axum/src/extract/path/mod.rs @@ -343,25 +343,25 @@ impl fmt::Display for ErrorKind { expected_type, } => write!( f, - "Cannot parse `{key}` with value `{value:?}` to a `{expected_type}`" + "Cannot parse `{key}` with value `{value}` to a `{expected_type}`" ), ErrorKind::ParseError { value, expected_type, - } => write!(f, "Cannot parse `{value:?}` to a `{expected_type}`"), + } => write!(f, "Cannot parse `{value}` to a `{expected_type}`"), ErrorKind::ParseErrorAtIndex { index, value, expected_type, } => write!( f, - "Cannot parse value at index {index} with value `{value:?}` to a `{expected_type}`" + "Cannot parse value at index {index} with value `{value}` to a `{expected_type}`" ), ErrorKind::DeserializeError { key, value, message, - } => write!(f, "Cannot parse `{key}` with value `{value:?}`: {message}"), + } => write!(f, "Cannot parse `{key}` with value `{value}`: {message}"), } } } @@ -919,7 +919,7 @@ mod tests { let body = res.text().await; assert_eq!( body, - r#"Invalid URL: Cannot parse `res` with value `"123123-123-123123"`: UUID parsing failed: invalid group count: expected 5, found 3"# + r#"Invalid URL: Cannot parse `res` with value `123123-123-123123`: UUID parsing failed: invalid group count: expected 5, found 3"# ); } @@ -940,7 +940,7 @@ mod tests { let body = res.text().await; assert_eq!( body, - r#"Invalid URL: Cannot parse `res` with value `"456456-123-456456"`: UUID parsing failed: invalid group count: expected 5, found 3"# + r#"Invalid URL: Cannot parse `res` with value `456456-123-456456`: UUID parsing failed: invalid group count: expected 5, found 3"# ); } }