@@ -14,9 +14,9 @@ configuring the settings for a target.
14
14
15
15
The library target defines a "library" that can be used and linked by other
16
16
libraries and executables. The filename defaults to ` src/lib.rs ` , and the name
17
- of the library defaults to the name of the package. A package can have only
18
- one library. The settings for the library can be [ customized ] in the ` [lib] `
19
- table in ` Cargo.toml ` .
17
+ of the library defaults to the name of the package, with any dashes replaced
18
+ with underscores. A package can have only one library. The settings for the
19
+ library can be [ customized ] in the ` [lib] ` table in ` Cargo.toml ` .
20
20
21
21
``` toml
22
22
# Example of customizing the library in Cargo.toml.
@@ -198,9 +198,10 @@ The `name` field specifies the name of the target, which corresponds to the
198
198
filename of the artifact that will be generated. For a library, this is the
199
199
crate name that dependencies will use to reference it.
200
200
201
- For the ` [lib] ` and the default binary (` src/main.rs ` ), this defaults to the
202
- name of the package, with any dashes replaced with underscores. For other
203
- [ auto discovered] ( #target-auto-discovery ) targets, it defaults to the
201
+ For the library target, this defaults to the name of the package , with any
202
+ dashes replaced with underscores. For the default binary (` src/main.rs ` ),
203
+ it also defaults to the name of the package, with no replacement for dashes.
204
+ For [ auto discovered] ( #target-auto-discovery ) targets, it defaults to the
204
205
directory or file name.
205
206
206
207
This is required for all targets except ` [lib] ` .
0 commit comments