Skip to content

Commit ddeedb9

Browse files
committed
Allow . in feature name
Signed-off-by: hi-rustin <[email protected]>
1 parent 8262b29 commit ddeedb9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/models/krate.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl Crate {
225225
!name.is_empty()
226226
&& name
227227
.chars()
228-
.all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-' || c == '+')
228+
.all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-' || c == '+' || c == '.')
229229
}
230230

231231
/// Validates the prefix in front of the slash: `features = ["THIS/feature"]`.
@@ -531,5 +531,7 @@ mod tests {
531531
assert!(!Crate::valid_feature("dep:foo?/bar"));
532532
assert!(!Crate::valid_feature("foo/?bar"));
533533
assert!(!Crate::valid_feature("foo?bar"));
534+
assert!(Crate::valid_feature("bar.web"));
535+
assert!(Crate::valid_feature("foo/bar.web"));
534536
}
535537
}

0 commit comments

Comments
 (0)