@@ -6,9 +6,8 @@ use crate::ops::{CompileFilter, CompileOptions, NewOptions, Packages, VersionCon
6
6
use crate :: util:: important_paths:: find_root_manifest_for_wd;
7
7
use crate :: util:: interning:: InternedString ;
8
8
use crate :: util:: is_rustup;
9
- use crate :: util:: restricted_names:: is_glob_pattern;
10
- use crate :: util:: toml:: schema:: { StringOrVec , TomlProfile } ;
11
- use crate :: util:: validate_package_name;
9
+ use crate :: util:: restricted_names;
10
+ use crate :: util:: toml:: schema:: StringOrVec ;
12
11
use crate :: util:: {
13
12
print_available_benches, print_available_binaries, print_available_examples,
14
13
print_available_packages, print_available_tests,
@@ -607,7 +606,7 @@ Run `{cmd}` to see possible targets."
607
606
bail ! ( "profile `doc` is reserved and not allowed to be explicitly specified" )
608
607
}
609
608
( _, _, Some ( name) ) => {
610
- TomlProfile :: validate_name ( name) ?;
609
+ restricted_names :: validate_profile_name ( name) ?;
611
610
name
612
611
}
613
612
} ;
@@ -801,7 +800,7 @@ Run `{cmd}` to see possible targets."
801
800
) -> CargoResult < CompileOptions > {
802
801
let mut compile_opts = self . compile_options ( config, mode, workspace, profile_checking) ?;
803
802
let spec = self . _values_of ( "package" ) ;
804
- if spec. iter ( ) . any ( is_glob_pattern) {
803
+ if spec. iter ( ) . any ( restricted_names :: is_glob_pattern) {
805
804
anyhow:: bail!( "Glob patterns on package selection are not supported." )
806
805
}
807
806
compile_opts. spec = Packages :: Packages ( spec) ;
@@ -835,7 +834,7 @@ Run `{cmd}` to see possible targets."
835
834
( None , None ) => config. default_registry ( ) ?. map ( RegistryOrIndex :: Registry ) ,
836
835
( None , Some ( i) ) => Some ( RegistryOrIndex :: Index ( i. into_url ( ) ?) ) ,
837
836
( Some ( r) , None ) => {
838
- validate_package_name ( r, "registry name" , "" ) ?;
837
+ restricted_names :: validate_package_name ( r, "registry name" , "" ) ?;
839
838
Some ( RegistryOrIndex :: Registry ( r. to_string ( ) ) )
840
839
}
841
840
( Some ( _) , Some ( _) ) => {
@@ -850,7 +849,7 @@ Run `{cmd}` to see possible targets."
850
849
match self . _value_of ( "registry" ) . map ( |s| s. to_string ( ) ) {
851
850
None => config. default_registry ( ) ,
852
851
Some ( registry) => {
853
- validate_package_name ( & registry, "registry name" , "" ) ?;
852
+ restricted_names :: validate_package_name ( & registry, "registry name" , "" ) ?;
854
853
Ok ( Some ( registry) )
855
854
}
856
855
}
0 commit comments