-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the @
boxes from extra::json
#10727
Conversation
This is awesome! Last time I tried doing this lifetimes got the best of me and the compiler gave me lots of ICEs, but I'm glad to see that it's all working now. I think that @pcwalton is actually trying to change |
@alexcrichton: Sure. I updated the PR with |
let s = @mut MemWriter::new(); | ||
self.to_pretty_writer(s as @mut io::Writer); | ||
let mut s = MemWriter::new(); | ||
self.to_pretty_writer(&mut s as &mut io::Writer); | ||
str::from_utf8(s.inner_ref().as_slice()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you convert this to str::from_utf8_owned(s.inner())
to save a copy? (Similarly for all the other places (librustdoc, etc.) that use (@mut MemWriter).inner_ref()
; including the ToStr for Json
instance in this file, which you appear to have not removed @mut
from?)
This PR does some small modernizations to the json library. First is to remove the `@` boxes, second is to rename the constructors to `new`.
…shearth Extend `trait_duplication_in_bounds` to cover trait objects This PR extends `trait_duplication_in_bounds` to cover trait objects. Currently, ```rs fn foo(_a: &(dyn Any + Send + Send)) {} ``` generates no warnings. With this PR, it will complain about a duplicate trait and can remove it Moved from rust-lang#110991 changelog: [`trait_duplication_in_bounds`]: warn on duplicate trait object constraints
This PR does some small modernizations to the json library. First is to remove the
@
boxes, second is to rename the constructors tonew
.