Skip to content

Commit

Permalink
Auto merge of #128252 - EtomicBomb:pre-rfc, r=notriddle
Browse files Browse the repository at this point in the history
modularize rustdoc's write_shared

Refactor src/librustdoc/html/render/write_shared.rs to reduce code duplication, adding unit tests

* Extract + unit test code for sorting and rendering JSON, which is duplicated 9 times in the current impl
* Extract + unit test code for encoding JSON as single quoted strings, which is duplicated twice in the current impl
* Unit tests for cross-crate information file formats
* Generic interface to add new kinds of cross-crate information files in the future
* Intended to match current behavior exactly, except for a merge info comment it adds to the bottom of cci files
* This PR is intended to reduce the review burden from my [mergeable rustdoc rfc](rust-lang/rfcs#3662) implementation PR, which is a [small commit based on this branch](https://github.com/EtomicBomb/rust/tree/rfc). This code is agnostic to the RFC and does not include any of the flags discussed there, but cleanly enables the addition of these flags in the future because it is more modular
  • Loading branch information
bors committed Aug 20, 2024
2 parents bfb4e65 + 199ce2e commit 86bc03c
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 86bc03c

Please sign in to comment.