Skip to content

Commit

Permalink
feat(extract::Path): change format of value in ErrorKind to non-Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
vegardgs-ksat committed Apr 25, 2024
1 parent b0f51d8 commit 85e31f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions axum/src/extract/path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"),
}
}
}
Expand Down Expand Up @@ -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"#
);
}

Expand All @@ -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"#
);
}
}

0 comments on commit 85e31f3

Please sign in to comment.