Skip to content

Commit 5e85c6e

Browse files
committed
doc/manifest: polish typography
1 parent 7f8a3fc commit 5e85c6e

File tree

1 file changed

+73
-73
lines changed

1 file changed

+73
-73
lines changed

src/doc/manifest.md

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ repository by mistake.
8181
publish = false
8282
```
8383

84-
## Package metadata
84+
## Package Metadata
8585

8686
There are a number of optional metadata fields also accepted under the
8787
`[package]` section:
@@ -91,15 +91,15 @@ There are a number of optional metadata fields also accepted under the
9191
# ...
9292

9393
# A short blurb about the package. This is not rendered in any format when
94-
# uploaded to crates.io (aka this is not markdown)
94+
# uploaded to crates.io (aka this is not markdown).
9595
description = "..."
9696

97-
# These URLs point to more information about the repository
97+
# These URLs point to more information about the repository.
9898
documentation = "..."
9999
homepage = "..."
100100
repository = "..."
101101

102-
# This points to a file in the repository (relative to this Cargo.toml). The
102+
# This points to a file in the repository (relative to this `Cargo.toml`). The
103103
# contents of this file are stored and indexed in the registry.
104104
readme = "..."
105105

@@ -110,12 +110,12 @@ keywords = ["...", "..."]
110110
# This is a string description of the license for this package. Currently
111111
# crates.io will validate the license provided against a whitelist of known
112112
# license identifiers from http://spdx.org/licenses/. Multiple licenses can be
113-
# separated with a `/`
113+
# separated with a `/`.
114114
license = "..."
115115

116116
# If a project is using a nonstandard license, then this key may be specified in
117117
# lieu of the above key and must point to a file relative to this manifest
118-
# (similar to the readme key)
118+
# (similar to the readme key).
119119
license-file = "..."
120120
```
121121

@@ -142,13 +142,13 @@ geometry = { path = "crates/geometry" }
142142

143143
You can specify the source of a dependency in a few ways:
144144

145-
* `git = "<git-url>"`: A git repository with a `Cargo.toml` inside it (not
146-
necessarily at the root). The `rev`, `tag`, and `branch` options are also
145+
* `git = "<git-url>"` refers to a git repository with a `Cargo.toml` inside it
146+
(not necessarily at the root). The `rev`, `tag`, and `branch` options are also
147147
recognized to use something other than the `master` branch.
148-
* `path = "<relative-path>"`: A path relative to the current `Cargo.toml`
149-
pointing to another directory with a `Cargo.toml` and an associated package.
150-
* If `path` and `git` are omitted, then a dependencies will come from crates.io
151-
and use the `version` key to indicate the version requirement.
148+
* `path = "<relative-path>"` refers to another directory with a `Cargo.toml`
149+
inside it. The specified path should be relative to the current `Cargo.toml`.
150+
* If `path` and `git` are omitted, the dependency will come from crates.io, and
151+
the `version` key will be used to indicate the version requirement.
152152

153153
Dependencies from crates.io can also use a shorthand where just the version
154154
requirement is specified:
@@ -213,8 +213,8 @@ native = { path = "native/x86_64" }
213213

214214
# The `[profile.*]` Sections
215215

216-
Cargo supports custom configuration of how rustc is invoked through **profiles**
217-
at the top level. Any manifest may declare a profile, but only the **top level**
216+
Cargo supports custom configuration of how rustc is invoked through profiles at
217+
the top level. Any manifest may declare a profile, but only the top level
218218
project’s profiles are actually read. All dependencies’ profiles will be
219219
overridden. This is done so the top-level project has control over how its
220220
dependencies are compiled.
@@ -224,17 +224,17 @@ configuration available to them. Listed below is the configuration available,
224224
along with the defaults for each profile.
225225

226226
```toml
227-
# The development profile, used for `cargo build`
227+
# The development profile, used for `cargo build`.
228228
[profile.dev]
229-
opt-level = 0 # Controls the --opt-level the compiler builds with
230-
debug = true # Controls whether the compiler passes `-g`
231-
rpath = false # Controls whether the compiler passes `-C rpath`
232-
lto = false # Controls `-C lto` for binaries and staticlibs
233-
debug-assertions = true # Controls whether debug assertions are enabled
234-
codegen-units = 1 # Controls whether the compiler passes `-C codegen-units`
235-
# `codegen-units` is ignored when `lto = true`
236-
237-
# The release profile, used for `cargo build --release`
229+
opt-level = 0 # controls the `--opt-level` the compiler builds with
230+
debug = true # controls whether the compiler passes `-g`
231+
rpath = false # controls whether the compiler passes `-C rpath`
232+
lto = false # controls `-C lto` for binaries and staticlibs
233+
debug-assertions = true # controls whether debug assertions are enabled
234+
codegen-units = 1 # controls whether the compiler passes `-C codegen-units`
235+
# `codegen-units` is ignored when `lto = true`
236+
237+
# The release profile, used for `cargo build --release`.
238238
[profile.release]
239239
opt-level = 3
240240
debug = false
@@ -243,7 +243,7 @@ lto = false
243243
debug-assertions = false
244244
codegen-units = 1
245245

246-
# The testing profile, used for `cargo test`
246+
# The testing profile, used for `cargo test`.
247247
[profile.test]
248248
opt-level = 0
249249
debug = true
@@ -252,7 +252,7 @@ lto = false
252252
debug-assertions = true
253253
codegen-units = 1
254254

255-
# The benchmarking profile, used for `cargo bench`
255+
# The benchmarking profile, used for `cargo bench`.
256256
[profile.bench]
257257
opt-level = 3
258258
debug = false
@@ -261,7 +261,7 @@ lto = false
261261
debug-assertions = false
262262
codegen-units = 1
263263

264-
# The documentation profile, used for `cargo doc`
264+
# The documentation profile, used for `cargo doc`.
265265
[profile.doc]
266266
opt-level = 0
267267
debug = true
@@ -273,13 +273,13 @@ codegen-units = 1
273273

274274
# The `[features]` Section
275275

276-
Cargo supports **features** to allow expression of:
276+
Cargo supports features to allow expression of:
277277

278-
* Conditional compilation options (usable through `cfg` attributes);
279-
* Optional dependencies, which enhance a package, but are not required;
280-
* Clusters of optional dependencies, such as postgres, that would include the
278+
* conditional compilation options (usable through `cfg` attributes);
279+
* optional dependencies, which enhance a package, but are not required; and
280+
* clusters of optional dependencies, such as `postgres`, that would include the
281281
`postgres` package, the `postgres-macros` package, and possibly other packages
282-
(such as development-time mocking libraries, debugging tools, etc.)
282+
(such as development-time mocking libraries, debugging tools, etc.).
283283

284284
A feature of a package is either an optional dependency, or a set of other
285285
features. The format for specifying features is:
@@ -289,7 +289,7 @@ features. The format for specifying features is:
289289
name = "awesome"
290290

291291
[features]
292-
# The default set of optional packages. Most people will want to use these
292+
# The default set of optional packages. Most people will want to use these
293293
# packages, but they are strictly optional. Note that `session` is not a package
294294
# but rather another feature listed in this manifest.
295295
default = ["jquery", "uglifier", "session"]
@@ -298,7 +298,7 @@ default = ["jquery", "uglifier", "session"]
298298
# like `#[cfg(feature = "go-faster")]`.
299299
go-faster = []
300300

301-
# The secure-password feature depends on the bcrypt package. This aliasing
301+
# The `secure-password` feature depends on the bcrypt package. This aliasing
302302
# will allow people to talk about the feature in a higher-level way and allow
303303
# this package to add more requirements to the feature in the future.
304304
secure-password = ["bcrypt"]
@@ -309,13 +309,13 @@ secure-password = ["bcrypt"]
309309
session = ["cookie/session"]
310310

311311
[dependencies]
312-
# These packages are mandatory and form the core of this package’s distribution
312+
# These packages are mandatory and form the core of this package’s distribution.
313313
cookie = "1.2.0"
314314
oauth = "1.1.0"
315315
route-recognizer = "=2.1.0"
316316

317317
# A list of all of the optional dependencies, some of which are included in the
318-
# above features. They can be opted into by apps.
318+
# above `features`. They can be opted into by apps.
319319
jquery = { version = "1.0.2", optional = true }
320320
uglifier = { version = "1.5.3", optional = true }
321321
bcrypt = { version = "*", optional = true }
@@ -338,23 +338,23 @@ The usage of features is subject to a few rules:
338338

339339
1. Feature names must not conflict with other package names in the manifest.
340340
This is because they are opted into via `features = [...]`, which only has a
341-
single namespace
341+
single namespace.
342342
2. With the exception of the `default` feature, all features are opt-in. To opt
343343
out of the default feature, use `default-features = false` and cherry-pick
344344
individual features.
345345
3. Feature groups are not allowed to cyclically depend on one another.
346-
4. Dev-dependencies cannot be optional
347-
5. Features groups can only reference optional dependencies
346+
4. Dev-dependencies cannot be optional.
347+
5. Features groups can only reference optional dependencies.
348348
6. When a feature is selected, Cargo will call `rustc` with `--cfg
349349
feature="${feature_name}"`. If a feature group is included, it and all of its
350350
individual features will be included. This can be tested in code via
351-
`#[cfg(feature = "foo")]`
351+
`#[cfg(feature = "foo")]`.
352352

353353
Note that it is explicitly allowed for features to not actually activate any
354354
optional dependencies. This allows packages to internally enable/disable
355355
features without requiring a new dependency.
356356

357-
## Usage In End Products
357+
## Usage in End Products
358358

359359
One major use-case for this feature is specifying optional features in
360360
end-products. For example, the Servo project may want to include optional
@@ -369,28 +369,28 @@ $ cargo build --release --features "shumway pdf"
369369

370370
Default features could be excluded using `--no-default-features`.
371371

372-
## Usage In Packages
372+
## Usage in Packages
373373

374-
In most cases, the concept of optional dependency in a library is best
374+
In most cases, the concept of *optional dependency* in a library is best
375375
expressed as a separate package that the top-level application depends on.
376376

377377
However, high-level packages, like Iron or Piston, may want the ability to
378378
curate a number of packages for easy installation. The current Cargo system
379379
allows them to curate a number of mandatory dependencies into a single package
380380
for easy installation.
381381

382-
In some cases, packages may want to provide additional curation for **optional**
382+
In some cases, packages may want to provide additional curation for optional
383383
dependencies:
384384

385-
* Grouping a number of low-level optional dependencies together into a single
386-
high-level feature”.
387-
* Specifying packages that are recommended (or suggested) to be included by
388-
users of the package.
389-
* Including a feature (like `secure-password` in the motivating example) that
385+
* grouping a number of low-level optional dependencies together into a single
386+
high-level feature;
387+
* specifying packages that are recommended (or suggested) to be included by
388+
users of the package; and
389+
* including a feature (like `secure-password` in the motivating example) that
390390
will only work if an optional dependency is available, and would be difficult
391-
to implement as a separate package. For example, it may be overly difficult to
391+
to implement as a separate package (for example, it may be overly difficult to
392392
design an IO package to be completely decoupled from OpenSSL, with opt-in via
393-
the inclusion of a separate package.
393+
the inclusion of a separate package).
394394

395395
In almost all cases, it is an antipattern to use these features outside of
396396
high-level packages that are designed for curation. If a feature is optional, it
@@ -417,16 +417,16 @@ Your project can optionally contain folders named `examples`, `tests`, and
417417
integration tests, and benchmarks respectively.
418418

419419
```notrust
420-
▾ src/ # directory containing source files
421-
lib.rs # the main entry point for libraries and packages
422-
main.rs # the main entry point for projects producing executables
423-
▾ bin/ # (optional) directory containing additional executables
420+
▾ src/ # directory containing source files
421+
lib.rs # the main entry point for libraries and packages
422+
main.rs # the main entry point for projects producing executables
423+
▾ bin/ # (optional) directory containing additional executables
424424
*.rs
425-
▾ examples/ # (optional) examples
425+
▾ examples/ # (optional) examples
426426
*.rs
427-
▾ tests/ # (optional) integration tests
427+
▾ tests/ # (optional) integration tests
428428
*.rs
429-
▾ benches/ # (optional) benchmarks
429+
▾ benches/ # (optional) benchmarks
430430
*.rs
431431
```
432432

@@ -446,14 +446,15 @@ You can run individual examples with the command `cargo run --example
446446

447447
When you run `cargo test`, Cargo will:
448448

449-
* Compile and run your library’s unit tests, which are in files reachable from
450-
`lib.rs`. Any sections marked with `#[cfg(test)]` will be included.
451-
* Compile and run your library’s documentation tests, which are embedded inside
452-
of documentation blocks.
453-
* Compile and run your library’s [integration tests](#integration-tests).
454-
* Compile your library’s examples.
449+
* compile and run your library’s unit tests, which are in the files reachable
450+
from `lib.rs` (naturally, any sections marked with `#[cfg(test)]` will be
451+
considered at this stage);
452+
* compile and run your library’s documentation tests, which are embedded inside
453+
of documentation blocks;
454+
* compile and run your library’s [integration tests](#integration-tests); and
455+
* compile your library’s examples.
455456

456-
## Integration tests
457+
## Integration Tests
457458

458459
Each file in `tests/*.rs` is an integration test. When you run `cargo test`,
459460
Cargo will compile each of these files as a separate crate. The crate can link
@@ -466,7 +467,7 @@ example, if you want several integration tests to share some code, you can put
466467
the shared code in `tests/common/mod.rs` and then put `mod common;` in each of
467468
the test files.
468469

469-
# Configuring a target
470+
# Configuring a Target
470471

471472
All of the `[[bin]]`, `[lib]`, `[[bench]]`, `[[test]]`, and `[[example]]`
472473
sections support similar configuration for specifying how a target should be
@@ -483,7 +484,7 @@ specified.
483484
# is defaulted to the name of the package or project.
484485
name = "foo"
485486

486-
# This field points at where the crate is located, relative to the Cargo.toml.
487+
# This field points at where the crate is located, relative to the `Cargo.toml`.
487488
path = "src/lib.rs"
488489

489490
# A flag for enabling unit tests for this target. This is used by `cargo test`.
@@ -504,9 +505,9 @@ doc = true
504505
# for Cargo to correctly compile it and make it available for all dependencies.
505506
plugin = false
506507

507-
# If set to false, `cargo test` will omit the --test flag to rustc, which stops
508-
# it from generating a test harness. This is useful when the binary being built
509-
# manages the test runner itself.
508+
# If set to false, `cargo test` will omit the `--test` flag to rustc, which
509+
# stops it from generating a test harness. This is useful when the binary being
510+
# built manages the test runner itself.
510511
harness = true
511512
```
512513

@@ -520,10 +521,9 @@ build by explicitly listing the library in your `Cargo.toml`:
520521

521522
[lib]
522523
name = "..."
523-
# this could be “staticlib” as well
524-
crate-type = ["dylib"]
524+
crate-type = ["dylib"] # could be `staticlib` as well
525525
```
526526

527527
The available options are `dylib`, `rlib`, and `staticlib`. You should only use
528-
this option in a project. Cargo will always compile **packages** (dependencies)
528+
this option in a project. Cargo will always compile packages (dependencies)
529529
based on the requirements of the project that includes them.

0 commit comments

Comments
 (0)