Impl fmt::Write for Either#113
Conversation
jswrenn
left a comment
There was a problem hiding this comment.
Thanks for the PR! Just one small nit/question.
Happy to hear we can do something to make rustdoc a little better. :)
src/lib.rs
Outdated
| R: fmt::Write, | ||
| { | ||
| fn write_str(&mut self, s: &str) -> fmt::Result { | ||
| for_both!(*self, ref mut inner => inner.write_str(s)) |
There was a problem hiding this comment.
If you write this instead, can you do this without the ref mut?
| for_both!(*self, ref mut inner => inner.write_str(s)) | |
| for_both!(self, inner => inner.write_str(s)) |
There was a problem hiding this comment.
Fixed and rebased.
BTW, I was doing this just to be consistent with the rest of the code, e.g.:
Line 1410 in bd0fe70
There was a problem hiding this comment.
Looks like that was pushed 10 years ago, so it's either a historical accident, or.a quirk of pattern ergonomics.
We'll see if the change passes CI...
There was a problem hiding this comment.
Probably happened before match ergonomics were improved. I was gonna open a PR to simplify all those patterns, but have already opened 3 just today, so I'll wait with that. 😅
|
BTW, I was surprised CI is green without #112 , but I think it's just because the registry is cached! |
|
In my experience with maintaining zerocopy (msrv of 1.55), if you blow away the |
|
Except 1.37 is so old it doesn't respect the |
|
Ah, I could have sworn we already had this, but that was |
Found myself needing this (while working on
rustdoc).