Skip to content

ParseChar error always suggests urn:uuid: is a valid prefix #862

Description

@ginnyTheCat

When parsing an invalid UUID using Hyphenated

use std::str::FromStr;

use uuid::fmt::Hyphenated;

fn main() {
    println!("{}", Hyphenated::from_str("abcdefg").unwrap_err());
}

the following error is logged:

invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `g` at 7

In this case urn:uuid: is, however, not allowed, since it's being parsed using Hyphenated not a Uuid. This is quite confusing since it suggests to API consumers that this is a supported format, even though it's explicitly disallowed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions