@@ -6,9 +6,8 @@ use crate::ops::{CompileFilter, CompileOptions, NewOptions, Packages, VersionCon
66use crate :: util:: important_paths:: find_root_manifest_for_wd;
77use crate :: util:: interning:: InternedString ;
88use 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 ;
1211use crate :: util:: {
1312 print_available_benches, print_available_binaries, print_available_examples,
1413 print_available_packages, print_available_tests,
@@ -607,7 +606,7 @@ Run `{cmd}` to see possible targets."
607606 bail ! ( "profile `doc` is reserved and not allowed to be explicitly specified" )
608607 }
609608 ( _, _, Some ( name) ) => {
610- TomlProfile :: validate_name ( name) ?;
609+ restricted_names :: validate_profile_name ( name) ?;
611610 name
612611 }
613612 } ;
@@ -801,7 +800,7 @@ Run `{cmd}` to see possible targets."
801800 ) -> CargoResult < CompileOptions > {
802801 let mut compile_opts = self . compile_options ( config, mode, workspace, profile_checking) ?;
803802 let spec = self . _values_of ( "package" ) ;
804- if spec. iter ( ) . any ( is_glob_pattern) {
803+ if spec. iter ( ) . any ( restricted_names :: is_glob_pattern) {
805804 anyhow:: bail!( "Glob patterns on package selection are not supported." )
806805 }
807806 compile_opts. spec = Packages :: Packages ( spec) ;
@@ -835,7 +834,7 @@ Run `{cmd}` to see possible targets."
835834 ( None , None ) => config. default_registry ( ) ?. map ( RegistryOrIndex :: Registry ) ,
836835 ( None , Some ( i) ) => Some ( RegistryOrIndex :: Index ( i. into_url ( ) ?) ) ,
837836 ( Some ( r) , None ) => {
838- validate_package_name ( r, "registry name" , "" ) ?;
837+ restricted_names :: validate_package_name ( r, "registry name" , "" ) ?;
839838 Some ( RegistryOrIndex :: Registry ( r. to_string ( ) ) )
840839 }
841840 ( Some ( _) , Some ( _) ) => {
@@ -850,7 +849,7 @@ Run `{cmd}` to see possible targets."
850849 match self . _value_of ( "registry" ) . map ( |s| s. to_string ( ) ) {
851850 None => config. default_registry ( ) ,
852851 Some ( registry) => {
853- validate_package_name ( & registry, "registry name" , "" ) ?;
852+ restricted_names :: validate_package_name ( & registry, "registry name" , "" ) ?;
854853 Ok ( Some ( registry) )
855854 }
856855 }
0 commit comments