From 3fa44757389e7ad5e50294edd11018eda71ba9b1 Mon Sep 17 00:00:00 2001 From: Bas Bossink Date: Tue, 24 Jan 2023 18:23:00 +0100 Subject: [PATCH 1/2] Fix error message. Fixes: #655 --- src/error.rs | 2 +- src/external/serde_support.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index 6c3a4f43..e9aecbf8 100644 --- a/src/error.rs +++ b/src/error.rs @@ -134,7 +134,7 @@ impl fmt::Display for Error { ErrorKind::Char { character, index, .. } => { - write!(f, "invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-zA-Z], found `{}` at {}", character, index) + write!(f, "invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `{}` at {}", character, index) } ErrorKind::SimpleLength { len } => { write!( diff --git a/src/external/serde_support.rs b/src/external/serde_support.rs index 9c1a7244..5228daf1 100644 --- a/src/external/serde_support.rs +++ b/src/external/serde_support.rs @@ -302,7 +302,7 @@ mod serde_tests { fn test_de_failure() { serde_test::assert_de_tokens_error::>( &[Token::Str("hello_world")], - "UUID parsing failed: invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-zA-Z], found `h` at 1", + "UUID parsing failed: invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `h` at 1", ); serde_test::assert_de_tokens_error::>( From 40d8711f11e603f9ea01e192e30f087b969b27eb Mon Sep 17 00:00:00 2001 From: Bas Bossink Date: Tue, 24 Jan 2023 18:28:32 +0100 Subject: [PATCH 2/2] Also fix the doc comment --- src/macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/macros.rs b/src/macros.rs index de200486..281c5335 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -72,7 +72,7 @@ define_uuid_macro! { /// Provides the following compilation error: /// /// ```txt -/// error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found Z at 9 +/// error: invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found Z at 9 /// | /// | let id = uuid!("F9168C5E-ZEB2-4FAA-B6BF-329BF39FA1E4"); /// | ^