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?
|
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 |
|
} |
|
} |
By accident, I discovered that
VersionReqcan 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