@@ -96,7 +96,7 @@ impl RequestContext {
9696 } )
9797 }
9898
99- pub fn load_local_internal ( & mut self , project_args : & ProjectArgs ) -> Result < ( ) > {
99+ pub fn load_local_internal_config ( & mut self , project_args : & ProjectArgs ) -> Result < ( ) > {
100100 let workspace_path = project_args
101101 . workspace_path ( )
102102 . unwrap_or ( project_args. working_directory . clone ( ) ) ;
@@ -119,10 +119,10 @@ impl RequestContext {
119119 let config = project_internal. as_mut ( ) . unwrap ( ) ;
120120
121121 // Project id is preferred in this order:
122- // 1. Name given on command line
123- // 2. Name from .shuttle/config.toml file
124- match ( & project_args. name_or_id , & config. id ) {
125- // Command-line name parameter trumps everything
122+ // 1. Id given on command line
123+ // 2. Id from .shuttle/config.toml file
124+ match ( & project_args. id , & config. id ) {
125+ // Command-line id parameter trumps everything
126126 ( Some ( id_from_args) , _) => {
127127 trace ! ( "using command-line project id" ) ;
128128 config. id = Some ( id_from_args. clone ( ) ) ;
@@ -167,21 +167,16 @@ impl RequestContext {
167167 Ok ( ( ) )
168168 }
169169
170- /// Load the project configuration at the given `working_directory`
171- ///
172- /// Ensures that if `--name` is not specified on the command-line, and either the project
173- /// file does not exist, or it has not set the `name` key then the `ProjectConfig` instance
174- /// has `ProjectConfig.name = Some("crate-name")`.
175- pub fn load_local ( & mut self , project_args : & ProjectArgs ) -> Result < ( ) > {
176- // Shuttle.toml
170+ /// Load the Shuttle.toml project configuration at the given `working_directory`
171+ pub fn load_local_config ( & mut self , project_args : & ProjectArgs ) -> Result < ( ) > {
177172 let project = Self :: get_local_config ( project_args) ?;
178173
179174 self . project = Some ( project) ;
180175
181176 Ok ( ( ) )
182177 }
183178
184- pub fn get_local_config (
179+ fn get_local_config (
185180 project_args : & ProjectArgs ,
186181 ) -> Result < Config < LocalConfigManager , ProjectConfig > > {
187182 let workspace_path = project_args
@@ -209,7 +204,7 @@ impl RequestContext {
209204 // 2. Name from Shuttle.toml file
210205 // 3. Name from Cargo.toml package if it's a crate
211206 // 4. Name from the workspace directory if it's a workspace
212- match ( & project_args. name_or_id , & config. name ) {
207+ match ( & project_args. name , & config. name ) {
213208 // Command-line name parameter trumps everything
214209 ( Some ( name_from_args) , _) => {
215210 trace ! ( "using command-line project name" ) ;
@@ -379,7 +374,8 @@ mod tests {
379374 fn get_local_config_finds_name_in_cargo_toml ( ) {
380375 let project_args = ProjectArgs {
381376 working_directory : path_from_workspace_root ( "examples/axum/hello-world/" ) ,
382- name_or_id : None ,
377+ name : None ,
378+ id : None ,
383379 } ;
384380
385381 let local_config = RequestContext :: get_local_config ( & project_args) . unwrap ( ) ;
@@ -391,7 +387,8 @@ mod tests {
391387 fn get_local_config_finds_name_from_workspace_dir ( ) {
392388 let project_args = ProjectArgs {
393389 working_directory : path_from_workspace_root ( "examples/rocket/workspace/hello-world/" ) ,
394- name_or_id : None ,
390+ name : None ,
391+ id : None ,
395392 } ;
396393
397394 let local_config = RequestContext :: get_local_config ( & project_args) . unwrap ( ) ;
@@ -403,7 +400,8 @@ mod tests {
403400 fn setting_name_overrides_name_in_config ( ) {
404401 let project_args = ProjectArgs {
405402 working_directory : path_from_workspace_root ( "examples/axum/hello-world/" ) ,
406- name_or_id : Some ( "my-fancy-project-name" . to_owned ( ) ) ,
403+ name : Some ( "my-fancy-project-name" . to_owned ( ) ) ,
404+ id : None ,
407405 } ;
408406
409407 let local_config = RequestContext :: get_local_config ( & project_args) . unwrap ( ) ;
0 commit comments