We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 043a9da commit b5688d4Copy full SHA for b5688d4
src/models/krate.rs
@@ -297,10 +297,8 @@ impl Crate {
297
298
/// Validates a whole feature string, `features = ["THIS", "ALL/THIS"]`.
299
pub fn valid_feature(name: &str) -> bool {
300
- match name.find('/') {
301
- Some(pos) => {
302
- let (dep, dep_feat) = name.split_at(pos);
303
- let dep_feat = &dep_feat[1..];
+ match name.split_once('/') {
+ Some((dep, dep_feat)) => {
304
let dep = dep.strip_suffix('?').unwrap_or(dep);
305
Crate::valid_feature_prefix(dep) && Crate::valid_feature_name(dep_feat)
306
}
0 commit comments