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.
When parsing an invalid UUID using
Hyphenatedthe following error is logged:
In this case
urn:uuid:is, however, not allowed, since it's being parsed usingHyphenatednot aUuid. This is quite confusing since it suggests to API consumers that this is a supported format, even though it's explicitly disallowed.