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 95ed663 commit c63ce14Copy full SHA for c63ce14
src/models/krate.rs
@@ -261,7 +261,7 @@ impl Crate {
261
}
262
263
fn valid_ident(name: &str) -> bool {
264
- Self::valid_feature_name(name)
+ Self::valid_feature_prefix(name)
265
&& name
266
.chars()
267
.next()
@@ -599,6 +599,17 @@ mod tests {
599
None
600
);
601
602
+
603
+ #[test]
604
+ fn valid_name() {
605
+ assert!(Crate::valid_name("foo"));
606
+ assert!(!Crate::valid_name("京"));
607
+ assert!(!Crate::valid_name(""));
608
+ assert!(!Crate::valid_name("💝"));
609
+ assert!(Crate::valid_name("foo_underscore"));
610
+ assert!(Crate::valid_name("foo-dash"));
611
+ assert!(!Crate::valid_name("foo+plus"));
612
+ }
613
614
615
pub trait CrateVersions {
0 commit comments