Skip to content

fix: convert 9 remaining Display impls from write_str to pad - #6162

Merged
bug-ops merged 1 commit into
mainfrom
fix/6066-display-write-str-to-pad
Jul 12, 2026
Merged

fix: convert 9 remaining Display impls from write_str to pad#6162
bug-ops merged 1 commit into
mainfrom
fix/6066-display-write-str-to-pad

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

This is a preventive/tech-debt fix — no confirmed live width-spec call site exists for these types today (verified in the issue and re-verified during review), so the change closes off the anti-pattern before it can cause a visible rendering bug.

Closes #6066

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins (13186 passed, 0 failed)
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"
  • 9 new width-spec regression tests added and passing, verified with a negative-control check (reverting one pad back to write_str makes the corresponding test fail)

@github-actions github-actions Bot added documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes bug Something isn't working size/M Medium PR (51-200 lines) labels Jul 12, 2026
SessionKind/SessionStatus/SessionChannel were fixed in #6060 for the
same latent bug: Formatter::write_str silently ignores width/fill/align
flags from the caller's format spec, while Formatter::pad respects them.

Converts the remaining 9 instances of this pattern to f.pad(...):
ProviderKind, MemoryTier, ContentFidelity, EntityType, SourceKind,
ParameterKind, ExperimentSource, EdgeType, and Lang (found during
review, using a different self-accessor than the issue's original grep
pattern). Adds width-spec regression tests for each type.

Closes #6066
@bug-ops
bug-ops force-pushed the fix/6066-display-write-str-to-pad branch from ff9257a to aff3767 Compare July 12, 2026 19:02
@bug-ops
bug-ops enabled auto-merge (squash) July 12, 2026 19:03
@bug-ops
bug-ops merged commit db72e04 into main Jul 12, 2026
79 of 81 checks passed
@bug-ops
bug-ops deleted the fix/6066-display-write-str-to-pad branch July 12, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 more Display impls use Formatter::write_str instead of pad, same latent width-spec bug as #6015

1 participant