Integrate to the bootstrap process of rust-lang/rust #193
Conversation
b8b7f91 to
065a045
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #193 +/- ##
==========================================
- Coverage 90.27% 89.74% -0.54%
==========================================
Files 12 13 +1
Lines 3034 3052 +18
Branches 3034 3052 +18
==========================================
Hits 2739 2739
- Misses 207 225 +18
Partials 88 88 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| pulldown-cmark = { version = "0.9.2", default-features = false } | ||
| pulldown-cmark-to-cmark = "11.2.0" | ||
| regex = "1.10.4" | ||
| regex = "1.9" |
There was a problem hiding this comment.
We might get a PR from the dependabot, but we can then tell it to ignore the 1.10 releases.
| pub mod gettext; | ||
| pub use gettext::Gettext; |
There was a problem hiding this comment.
I'm not a fan of giving multiple public names for the same thing — could you instead make the module private?
| pub mod gettext; | |
| pub use gettext::Gettext; | |
| mod gettext; | |
| pub use gettext::Gettext; |
| let gettext = Gettext; | ||
| if gettext.supports_renderer(renderer) { |
There was a problem hiding this comment.
Would this work as well:
| let gettext = Gettext; | |
| if gettext.supports_renderer(renderer) { | |
| if Gettext::supports_renderer(renderer) { |
There was a problem hiding this comment.
I can't change the definition of supports_renderer and run because they are defined as methods of Preprocessor trait at https://docs.rs/mdbook/latest/mdbook/preprocess/trait.Preprocessor.html.
I can define another static method like impl_supports_renderer, and change it to Gettext::impl_supports_renderer,
but it may be redundant.
There was a problem hiding this comment.
Ah, I see now! The syntax I used above would only work if the supports_renderer method had no &self argument.
Then let's merge this PR as it is — and then later change the code here to create a single Gettext value and pass this around. That would be a little more natural, I think (thought it would just be a small refactor).
| let gettext = Gettext; | ||
| let book = gettext.run(&ctx, book)?; |
There was a problem hiding this comment.
Like above, I think we don't need the variable:
| let gettext = Gettext; | |
| let book = gettext.run(&ctx, book)?; | |
| let book = Gettext::run(&ctx, book)?; |
There was a problem hiding this comment.
Hi @dalance, can you try out this change and see if it compiles? If so, please add it to the PR. Thanks!
|
Hi @dalance, thanks a lot for the PR! I would like to merge it after the small conflicts are resolved. |
065a045 to
b44611b
Compare
|
Thank you for your review. I resolved conflict and fixed the module visibility. |
This PR changes the followings for rust-lang/rust#124731:
GettextpreprocessorCloses #191