Migrate item_trait_alias to Askama#112030
Conversation
|
(rustbot has picked a reviewer for you, use r? to override) |
|
Thanks! @bors r+ rollup |
|
📌 Commit 9520f591368f27e39637e7c566d693c7eeaab6e3 has been approved by It is now in the queue for this repository. |
There was a problem hiding this comment.
Something I just thought about: is it actually necessary to pass Buffer as argument to wrap_item? If we're forced to, would it make sense to have another wrap_item_write which would take impl fmt::Write instead?
There was a problem hiding this comment.
Yeah we could actually write another wrap_item_write that would take in impl fmt::Write and it would actually reduce the overhead of creating a buffer every single time.
fn wrap_item_write<F>(w: &mut impl fmt::Write, f: F)
where
F: FnOnce(&mut impl fmt::Write),
{
write!(w, r#"<pre class="rust item-decl"><code>"#).unwrap();
f(w);
write!(w, "</code></pre>").unwrap();
}
There was a problem hiding this comment.
Lets do it in this PR itself and then we can merge the rest, or do you want me to create a new PR to implement that function
There was a problem hiding this comment.
You can do it in this PR directly.
|
Waiting for an answer to my comment. @bors r- |
|
@GuillaumeGomez Implemented the wrap_item_write, looks like we can get rid of the buffer now. Let me know if you have any suggestions |
There was a problem hiding this comment.
Buffer actually already implements the fmt::Write trait. Wouldn't it be simpler to update wrap_item instead of creating a new function?
There was a problem hiding this comment.
Yeah that makes perfect sense, updated the function : )
|
Looks like it's all good, thanks for working on this! Once CI pass, r=me |
Implemented wrap_item_write Update wrap_item
e2d24f9 to
780719b
Compare
|
Could not assign reviewer from: |
|
No need to re-assign me every time, I get notifications for every event on a PR I'm subscribed to. ;) @bors r+ rollup |
…mpiler-errors Rollup of 7 pull requests Successful merges: - rust-lang#111670 (Require that const param tys implement `ConstParamTy`) - rust-lang#111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - rust-lang#112030 (Migrate `item_trait_alias` to Askama) - rust-lang#112150 (Support 128-bit atomics on all x86_64 Apple targets) - rust-lang#112174 (Fix broken link) - rust-lang#112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - rust-lang#112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - rust-lang#112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
…mpiler-errors Rollup of 7 pull requests Successful merges: - rust-lang#111670 (Require that const param tys implement `ConstParamTy`) - rust-lang#111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - rust-lang#112030 (Migrate `item_trait_alias` to Askama) - rust-lang#112150 (Support 128-bit atomics on all x86_64 Apple targets) - rust-lang#112174 (Fix broken link) - rust-lang#112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - rust-lang#112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - rust-lang#112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
This PR migrates
item_trait_aliasto AskamaRefers #108868