Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nyurik opened this issue Jul 12, 2024 · 0 comments
Open

Comments

@nyurik
Copy link

nyurik commented Jul 12, 2024

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
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant