uuid-rs / uuid

Generate and parse UUIDs.

Home Page:https://www.crates.io/crates/uuid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing error mentions incorrect characters as expected

basbossink-ds opened this issue · comments

What happened?
The error message given in a parsing error when deserializing a readable uuid, suggest to use characters which are illegal.

Steps to reproduce the behavior:

  1. Deserialize a readable uuid with invalid input .eg. "hello_world".
  2. An error is created with the message:
    "UUID parsing failed: invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-zA-Z], found `h` at 1"
    

What were you expecting?
The expected error message for this case should in my humble opinion be:

"UUID parsing failed: invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `h` at 1"

What's the context?

  • Target: rustc 1.66.0 (69f9c33d7 2022-12-12)
  • Version: main
  • Cargo features enabled: default