Skip to content

Commit a8f7db2

Browse files
authored
docs: Clean up doc comments (#14823)
### What does this PR try to resolve? I'm experimenting with API changes in Cargo and wanted to make it easier to find doc comments that need updating. I didn't see a lint to help with this but I did go ahead and apply the result of other documentation lints. ### How should we test and review this PR? I've not turned these lints on more generally - `clippy::doc_markdown` has some false positives we'd need to record in our config (`SemVer` and `SQLite`) - `clippy::too_long_first_doc_paragraph` pointed out a doc comment that, at a quick glance, I didn't see what summary to provide I also didn't wanted to get this in without making a policy decision of what lints are enabled. ### Additional information
2 parents c54a8e8 + e306556 commit a8f7db2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+162
-145
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benches/benchsuite/src/bin/capture-last-use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Utility for capturing a global cache last-use database based on the files
22
//! on a real-world system.
33
//!
4-
//! This will look in the CARGO_HOME of the current system and record last-use
4+
//! This will look in the `CARGO_HOME` of the current system and record last-use
55
//! data for all files in the cache. This is intended to provide a real-world
66
//! example for a benchmark that should be close to what a real set of data
77
//! should look like.

crates/cargo-test-support/src/compare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ macro_rules! impl_from_tuple_for_inmemorydir {
621621
};
622622
}
623623

624-
/// Extend `impl_from_tuple_for_inmemorydir`` to generate for the specified tuple and all smaller
624+
/// Extend `impl_from_tuple_for_inmemorydir` to generate for the specified tuple and all smaller
625625
/// tuples
626626
macro_rules! impl_from_tuples_for_inmemorydir {
627627
($var1:ident $path1:ident $data1:ident, $($var:ident $path:ident $data:ident),+) => {

crates/cargo-test-support/src/containers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! with the running container.
66
//!
77
//! Tests using containers must use `#[cargo_test(container_test)]` to disable
8-
//! them unless the CARGO_CONTAINER_TESTS environment variable is set.
8+
//! them unless the `CARGO_CONTAINER_TESTS` environment variable is set.
99
1010
use cargo_util::ProcessBuilder;
1111
use std::collections::HashMap;
@@ -36,7 +36,7 @@ pub struct ContainerHandle {
3636
/// This can only be used on Linux. macOS and Windows docker doesn't allow
3737
/// direct connection to the container.
3838
pub ip_address: String,
39-
/// Port mappings of container_port to host_port for ports exposed via EXPOSE.
39+
/// Port mappings of `container_port` to `host_port` for ports exposed via EXPOSE.
4040
pub port_mappings: HashMap<u16, u16>,
4141
}
4242

crates/cargo-test-support/src/cross_compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Note that cross-testing is very limited. You need to install the
44
//! "alternate" target to the host (32-bit for 64-bit hosts or vice-versa).
55
//!
6-
//! Set CFG_DISABLE_CROSS_TESTS=1 environment variable to disable these tests
6+
//! Set `CFG_DISABLE_CROSS_TESTS=1` environment variable to disable these tests
77
//! if you are unable to use the alternate target. Unfortunately 32-bit
88
//! support on macOS is going away, so macOS users are out of luck.
99
//!

crates/cargo-test-support/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ impl Execs {
890890
///
891891
/// Prefer [`Execs::with_stdout_data`] where possible.
892892
/// - `with` cannot be snapshotted
893-
/// - The absence of `without`` can either mean success or that the string being looked for
893+
/// - The absence of `without` can either mean success or that the string being looked for
894894
/// changed.
895895
///
896896
/// </div>
@@ -1565,9 +1565,10 @@ pub fn is_coarse_mtime() -> bool {
15651565
cfg!(target_os = "macos") && is_ci()
15661566
}
15671567

1568+
/// A way for to increase the cut off for all the time based test.
1569+
///
15681570
/// Some CI setups are much slower then the equipment used by Cargo itself.
15691571
/// Architectures that do not have a modern processor, hardware emulation, etc.
1570-
/// This provides a way for those setups to increase the cut off for all the time based test.
15711572
pub fn slow_cpu_multiplier(main: u64) -> Duration {
15721573
static SLOW_CPU_MULTIPLIER: OnceLock<u64> = OnceLock::new();
15731574
let slow_cpu_multiplier = SLOW_CPU_MULTIPLIER.get_or_init(|| {

crates/cargo-test-support/src/paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static CARGO_INTEGRATION_TEST_DIR: &str = "cit";
1717
static GLOBAL_ROOT: OnceLock<Mutex<Option<PathBuf>>> = OnceLock::new();
1818

1919
/// This is used when running cargo is pre-CARGO_TARGET_TMPDIR
20-
/// TODO: Remove when CARGO_TARGET_TMPDIR grows old enough.
20+
/// TODO: Remove when `CARGO_TARGET_TMPDIR` grows old enough.
2121
fn global_root_legacy() -> PathBuf {
2222
let mut path = t!(env::current_exe());
2323
path.pop(); // chop off exe name

crates/cargo-test-support/src/publish.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ fn read_new_post(new_path: &Path) -> (Vec<u8>, Vec<u8>) {
166166
///
167167
/// - `expected_crate_name` should be something like `foo-0.0.1.crate`.
168168
/// - `expected_files` should be a complete list of files in the crate
169-
/// (relative to expected_crate_name).
169+
/// (relative to `expected_crate_name`).
170170
/// - `expected_contents` should be a list of `(file_name, contents)` tuples
171171
/// to validate the contents of the given file. Only the listed files will
172172
/// be checked (others will be ignored).

crates/cargo-util-schemas/src/manifest/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ impl<'de> de::Deserialize<'de> for InvalidCargoFeatures {
16801680
}
16811681
}
16821682

1683-
/// A StringOrVec can be parsed from either a TOML string or array,
1683+
/// This can be parsed from either a TOML string or array,
16841684
/// but is always stored as a vector.
16851685
#[derive(Clone, Debug, Serialize, Eq, PartialEq, PartialOrd, Ord)]
16861686
#[cfg_attr(feature = "unstable-schema", derive(schemars::JsonSchema))]

crates/cargo-util/src/paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()>
189189

190190
/// Writes a file to disk atomically.
191191
///
192-
/// write_atomic uses tempfile::persist to accomplish atomic writes.
192+
/// This uses `tempfile::persist` to accomplish atomic writes.
193193
pub fn write_atomic<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()> {
194194
let path = path.as_ref();
195195

0 commit comments

Comments
 (0)