Skip to content

docs(protocol): drop restatement comments in tests#4591

Merged
oferchen merged 1 commit into
masterfrom
docs/comment-cleanup-protocol
May 20, 2026
Merged

docs(protocol): drop restatement comments in tests#4591
oferchen merged 1 commit into
masterfrom
docs/comment-cleanup-protocol

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

Per-crate comment cleanup pass on the protocol crate, following the precedent set by PRs #4587 (matching), #4584 (filters), #4582 (logging), #4583 (platform), #4575 (compress).

The protocol crate is already in a strong state: #![deny(missing_docs)] is in force at the crate root, so every public type/trait/function/method already carries ///. Module-level doc comments cite upstream io.c, flist.c, compat.c, and the MSG_* / multiplex framing semantics where load-bearing. The single #[allow(unsafe_code)] in multiplex::helpers and its SAFETY block are preserved verbatim.

This follow-up strips a small set of pure restatement comments inside test bodies that simply echo the next line of code:

  • wire/vectored.rs - two "Verify all data was written" tags above a Vec::new() setup.
  • wire/compressed_token/lz4_codec.rs - three "Verify roundtrip" section labels above decoder construction.
  • wire/compressed_token/zstd_codec.rs - two "Verify roundtrip" section labels.
  • codec/mod.rs - "Write file size" / "Read it back" / "Write NDX values" / "Read them back" / "Mix wire and NDX operations" labels around codec round-trip tests. The substantive note about NDX deltas being stateful was kept (rewritten as a single line) because that is the actual reason a fresh codec is constructed on the reader side.
  • flist/flags.rs - "Test with all three bytes" above an inline u32 literal that visibly contains three bytes.
  • flist/write/tests/compression.rs - dropped two restating lines and three trailing // Same time/// Same UID/// Same GID tags that duplicated the line content. The function-level upstream cite for XMIT_EXTENDED_FLAGS/end-marker collision is preserved at the top of the test.
  • flist/write/tests/hardlink.rs - one "Read back" section label.

Scope coverage

  • Walked crates/protocol/src/ end to end.
  • Skipped per coordination note to avoid conflict with the parallel fix/sender-xattr-user-prefix-namespace branch (BR-3h):
    • crates/protocol/src/xattr/cache.rs
    • crates/protocol/src/xattr/prefix.rs
    • crates/protocol/src/xattr/wire/tests.rs
    • crates/protocol/src/flist/read/tests.rs
  • Verified that all upstream // upstream: io.c:NNN / // upstream: flist.c:NNN / // upstream: compat.c:NNN citations, varint/multiplex/version-negotiation WHY notes, INC_RECURSE segment-boundary explainers, and the multiplex::helpers SAFETY block are untouched.

Files touched: 7. Comment lines removed: 16. Lines added: 0 (one restatement was rewritten as a one-line NDX-state note).

No semantic changes. No new #[allow(...)] attributes. No rustdoc additions were necessary (the crate enforces missing_docs).

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings
  • CI matrix (fmt+clippy, nextest stable, Windows, macOS, Linux musl)

… items

Strip a handful of restating comments inside test bodies that echo the next
line of code (e.g., "Write file size", "Read it back", "Verify roundtrip",
"Verify all data was written", "Read back", "Test with all three bytes",
trailing "// Same time"/"// Same UID" tags). Upstream rsync citations,
varint/MSG_*/multiplex-frame WHY notes, the multiplex::helpers SAFETY
comment, and all rustdoc on public items are preserved unchanged.

Files touched: 7. Lines removed: 16. Lines added: 0 (one restatement was
collapsed into a one-line note about NDX delta state).

No semantic changes; no new #[allow(...)] attributes; the crate already
enforces #![deny(missing_docs)] so no additional rustdoc was required.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 20, 2026
@oferchen oferchen merged commit 374cf99 into master May 20, 2026
54 of 55 checks passed
oferchen added a commit that referenced this pull request May 20, 2026
… items (#4596)

Removes a small set of restatement comments in tests and SSH operand
parsing where the line above already echoes the test name or the
immediately following code (precedent: PRs #4587, #4589, #4590, #4591).

Preserves every upstream-rsync cite (`// upstream: ...`) and every WHY
note (SSH child process management, socketpair stderr, watchdog/drain
thread invariants, `-oBatchMode=yes` injection rationale, IPv6 zone-id
handling, secluded-args quoting).

The crate already enforces `#![deny(missing_docs)]`, so all public
items carry rustdoc; the only rustdoc edit converts two `///` headers
on private test helpers (`create_test_handshake`, `create_test_parts`)
into `//` comments, since rustdoc on private items adds no value
without WHY content.
@oferchen oferchen deleted the docs/comment-cleanup-protocol branch May 20, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant