Skip to content

Commit 5ea8e55

Browse files
committed
docs: fix the four rustdoc link errors that fail ci / Docs
`ci / Docs` runs rustdoc with `-D warnings`; four link defects in `trash-core` were errors under it, so `cargo doc` refused to document the crate (exit 101). All four predate this branch — the job only started running here. - windows.rs:34 and :141 — `[`Error`]` is ambiguous: the crate has both an `Error` enum and thiserror's `Error` derive macro. Disambiguated to `[`enum@Error`]`, rustdoc's own suggested form; both still link. - windows.rs:94 — the `NameLengthTooLarge` doc linked `MAX_V2_NAME_CHARS`, a crate-private const. Demoted to a code span and the value (32768) stated inline, so a reader gets the cap without a link to something unreachable. The const stays private. - linux.rs:42 — `[8]` is a footnote reference to the trash-spec, but markdown reads it as a reference link. Backticked. No `#![allow(rustdoc::...)]` anywhere; no item's visibility changed. Control (revert -> fail -> restore), same commit, same command `RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace --all-features`: with fix -> exit 0 fix reverted -> exit 101, 4 errors restored -> exit 0 `cargo fmt --check` clean. Only `ci / Docs` was in scope; no other check was touched.
1 parent 3fdac31 commit 5ea8e55

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎trash-core/src/linux.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
//! carries **no timezone** — it is naive *local* time, so it is decoded into a
4040
//! [`NaiveDateTime`] and must never be treated as UTC.
4141
//! * If `Path=` or `DeletionDate=` appears more than once, the **first**
42-
//! occurrence wins (spec footnote [8]).
42+
//! occurrence wins (spec footnote `[8]`).
4343
//!
4444
//! [`trash-forensic`]: https://docs.rs/trash-forensic
4545

‎trash-core/src/windows.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
//! followed by the variable-length UTF-16LE path at offset 28.
3232
//!
3333
//! All integers are read through bounds-checked helpers: `$I` bytes are treated
34-
//! as attacker-controlled, so a truncated or hostile file yields an [`Error`],
34+
//! as attacker-controlled, so a truncated or hostile file yields an [`enum@Error`],
3535
//! never a panic.
3636
//!
3737
//! [`trash-forensic`]: https://docs.rs/trash-forensic
@@ -91,7 +91,8 @@ pub enum Error {
9191
needed: usize,
9292
},
9393

94-
/// The version-2 name-length field exceeds [`MAX_V2_NAME_CHARS`] — rejected
94+
/// The version-2 name-length field exceeds the crate-private
95+
/// `MAX_V2_NAME_CHARS` cap (32768) — rejected
9596
/// before allocating to defend against a hostile length.
9697
#[error("$I v2 name length {chars} chars exceeds cap {MAX_V2_NAME_CHARS}")]
9798
NameLengthTooLarge {
@@ -138,7 +139,7 @@ pub struct RecycleBinIndex {
138139
///
139140
/// # Errors
140141
///
141-
/// Returns [`Error`] when the data is truncated, carries an unsupported version,
142+
/// Returns [`enum@Error`] when the data is truncated, carries an unsupported version,
142143
/// or (version 2) declares a filename length that overflows the buffer or the
143144
/// safety cap. Never panics on hostile input.
144145
pub fn parse_index(data: &[u8]) -> Result<RecycleBinIndex, Error> {

0 commit comments

Comments
 (0)