@@ -34,7 +34,7 @@ pub enum NameValidationError {
34
34
/// level of sanity. Note that package names have other restrictions
35
35
/// elsewhere. `cargo new` has a few restrictions, such as checking for
36
36
/// reserved names. crates.io has even more restrictions.
37
- pub fn validate_package_name ( name : & str , what : & ' static str ) -> Result < ( ) > {
37
+ pub ( crate ) fn validate_package_name ( name : & str , what : & ' static str ) -> Result < ( ) > {
38
38
if name. is_empty ( ) {
39
39
return Err ( NameValidationError :: Empty ( what) ) ;
40
40
}
@@ -75,7 +75,7 @@ pub fn validate_package_name(name: &str, what: &'static str) -> Result<()> {
75
75
}
76
76
77
77
/// Ensure a package name is [valid][validate_package_name]
78
- pub fn sanitize_package_name ( name : & str , placeholder : char ) -> String {
78
+ pub ( crate ) fn sanitize_package_name ( name : & str , placeholder : char ) -> String {
79
79
let mut slug = String :: new ( ) ;
80
80
let mut chars = name. chars ( ) ;
81
81
while let Some ( ch) = chars. next ( ) {
@@ -98,7 +98,7 @@ pub fn sanitize_package_name(name: &str, placeholder: char) -> String {
98
98
}
99
99
100
100
/// Validate dir-names and profile names according to RFC 2678.
101
- pub fn validate_profile_name ( name : & str ) -> Result < ( ) > {
101
+ pub ( crate ) fn validate_profile_name ( name : & str ) -> Result < ( ) > {
102
102
if let Some ( ch) = name
103
103
. chars ( )
104
104
. find ( |ch| !ch. is_alphanumeric ( ) && * ch != '_' && * ch != '-' )
@@ -164,7 +164,7 @@ pub fn validate_profile_name(name: &str) -> Result<()> {
164
164
Ok ( ( ) )
165
165
}
166
166
167
- pub fn validate_feature_name ( name : & str ) -> Result < ( ) > {
167
+ pub ( crate ) fn validate_feature_name ( name : & str ) -> Result < ( ) > {
168
168
let what = "feature name" ;
169
169
if name. is_empty ( ) {
170
170
return Err ( NameValidationError :: Empty ( what) ) ;
0 commit comments