Skip to content

Docs: Missing documentation that ['*', 'x', 'X'] can all be wildcards #322

@nyurik

Description

@nyurik

By accident, I discovered that VersionReq can parse all 3 of ['*', 'x', 'X'] characters as a wildcard, while it is not documented either here nor in cargo rust docs. Are there any difference between how they are used?

semver/src/parse.rs

Lines 191 to 201 in 4ea60ae

fn wildcard(input: &str) -> Option<(char, &str)> {
if let Some(rest) = input.strip_prefix('*') {
Some(('*', rest))
} else if let Some(rest) = input.strip_prefix('x') {
Some(('x', rest))
} else if let Some(rest) = input.strip_prefix('X') {
Some(('X', rest))
} else {
None
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions