@@ -27,7 +27,7 @@ pub enum VersionControl {
27
27
pub struct NewOptions {
28
28
pub version_control : Option < VersionControl > ,
29
29
pub kind : NewProjectKind ,
30
- /// Absolute path to the directory for the new project
30
+ /// Absolute path to the directory for the new package
31
31
pub path : PathBuf ,
32
32
pub name : Option < String > ,
33
33
pub edition : Option < String > ,
@@ -109,14 +109,14 @@ fn get_name<'a>(path: &'a Path, opts: &'a NewOptions) -> CargoResult<&'a str> {
109
109
110
110
let file_name = path. file_name ( ) . ok_or_else ( || {
111
111
format_err ! (
112
- "cannot auto-detect project name from path {:?} ; use --name to override" ,
112
+ "cannot auto-detect package name from path {:?} ; use --name to override" ,
113
113
path. as_os_str( )
114
114
)
115
115
} ) ?;
116
116
117
117
file_name. to_str ( ) . ok_or_else ( || {
118
118
format_err ! (
119
- "cannot create project with a non-unicode name: {:?}" ,
119
+ "cannot create package with a non-unicode name: {:?}" ,
120
120
file_name
121
121
)
122
122
} )
@@ -174,12 +174,12 @@ fn check_name(name: &str, opts: &NewOptions) -> CargoResult<()> {
174
174
}
175
175
176
176
fn detect_source_paths_and_types (
177
- project_path : & Path ,
178
- project_name : & str ,
177
+ package_path : & Path ,
178
+ package_name : & str ,
179
179
detected_files : & mut Vec < SourceFileInformation > ,
180
180
) -> CargoResult < ( ) > {
181
- let path = project_path ;
182
- let name = project_name ;
181
+ let path = package_path ;
182
+ let name = package_name ;
183
183
184
184
enum H {
185
185
Bin ,
@@ -233,20 +233,20 @@ fn detect_source_paths_and_types(
233
233
let sfi = match i. handling {
234
234
H :: Bin => SourceFileInformation {
235
235
relative_path : pp,
236
- target_name : project_name . to_string ( ) ,
236
+ target_name : package_name . to_string ( ) ,
237
237
bin : true ,
238
238
} ,
239
239
H :: Lib => SourceFileInformation {
240
240
relative_path : pp,
241
- target_name : project_name . to_string ( ) ,
241
+ target_name : package_name . to_string ( ) ,
242
242
bin : false ,
243
243
} ,
244
244
H :: Detect => {
245
245
let content = paths:: read ( & path. join ( pp. clone ( ) ) ) ?;
246
246
let isbin = content. contains ( "fn main" ) ;
247
247
SourceFileInformation {
248
248
relative_path : pp,
249
- target_name : project_name . to_string ( ) ,
249
+ target_name : package_name . to_string ( ) ,
250
250
bin : isbin,
251
251
}
252
252
}
@@ -276,7 +276,7 @@ cannot automatically generate Cargo.toml as the main target would be ambiguous",
276
276
} else {
277
277
if let Some ( plp) = previous_lib_relpath {
278
278
bail ! (
279
- "cannot have a project with \
279
+ "cannot have a package with \
280
280
multiple libraries, \
281
281
found both `{}` and `{}`",
282
282
plp,
@@ -290,17 +290,17 @@ cannot automatically generate Cargo.toml as the main target would be ambiguous",
290
290
Ok ( ( ) )
291
291
}
292
292
293
- fn plan_new_source_file ( bin : bool , project_name : String ) -> SourceFileInformation {
293
+ fn plan_new_source_file ( bin : bool , package_name : String ) -> SourceFileInformation {
294
294
if bin {
295
295
SourceFileInformation {
296
296
relative_path : "src/main.rs" . to_string ( ) ,
297
- target_name : project_name ,
297
+ target_name : package_name ,
298
298
bin : true ,
299
299
}
300
300
} else {
301
301
SourceFileInformation {
302
302
relative_path : "src/lib.rs" . to_string ( ) ,
303
- target_name : project_name ,
303
+ target_name : package_name ,
304
304
bin : false ,
305
305
}
306
306
}
@@ -330,7 +330,7 @@ pub fn new(opts: &NewOptions, config: &Config) -> CargoResult<()> {
330
330
331
331
mk ( config, & mkopts) . chain_err ( || {
332
332
format_err ! (
333
- "Failed to create project `{}` at `{}`" ,
333
+ "Failed to create package `{}` at `{}`" ,
334
334
name,
335
335
path. display( )
336
336
)
@@ -342,7 +342,7 @@ pub fn init(opts: &NewOptions, config: &Config) -> CargoResult<()> {
342
342
let path = & opts. path ;
343
343
344
344
if fs:: metadata ( & path. join ( "Cargo.toml" ) ) . is_ok ( ) {
345
- bail ! ( "`cargo init` cannot be run on existing Cargo projects " )
345
+ bail ! ( "`cargo init` cannot be run on existing Cargo packages " )
346
346
}
347
347
348
348
let name = get_name ( path, opts) ?;
@@ -356,7 +356,7 @@ pub fn init(opts: &NewOptions, config: &Config) -> CargoResult<()> {
356
356
src_paths_types. push ( plan_new_source_file ( opts. kind . is_bin ( ) , name. to_string ( ) ) ) ;
357
357
} else {
358
358
// --bin option may be ignored if lib.rs or src/lib.rs present
359
- // Maybe when doing `cargo init --bin` inside a library project stub,
359
+ // Maybe when doing `cargo init --bin` inside a library package stub,
360
360
// user may mean "initialize for library, but also add binary target"
361
361
}
362
362
@@ -407,7 +407,7 @@ pub fn init(opts: &NewOptions, config: &Config) -> CargoResult<()> {
407
407
408
408
mk ( config, & mkopts) . chain_err ( || {
409
409
format_err ! (
410
- "Failed to create project `{}` at `{}`" ,
410
+ "Failed to create package `{}` at `{}`" ,
411
411
name,
412
412
path. display( )
413
413
)
0 commit comments