Uh oh!
There was an error while loading. Please reload this page.
add Show impl for Tree{Map,Set} and cleanup - #14447
Conversation
sfackler
commented
May 26, 2014
Should that commented block be deleted or uncommented? |
lilyball
commented
May 26, 2014
Is there an actual need for |
There was a problem hiding this comment.
minimum_capacity is not guaranteed to be >= len. It's a minimum and is only modified by an explicit call to reserve() or, apparently, to clear().
lilyball
commented
May 26, 2014
Thinking about it some more, it seems to me that I'm assuming here that |
erickt
commented
May 26, 2014
@sfackler: parsing of escaped characters was replaced with https://github.com/mozilla/rust/blob/master/src/libserialize/json.rs#L1411 in #13469, which fixed decoding non-BMP hex escapes, so I think it should be okay to remove this dead code. It just got missed in a review. |
erickt
commented
May 26, 2014
@kballard: Yep, I added it because I wanted to add a bunch of items to an already existing |
lilyball
commented
May 26, 2014
@erickt
|
lilyball
commented
May 26, 2014
Basically, Given the difference of |
erickt
commented
May 26, 2014
@kballard: I still don't see the issue here :) In my opinion, the |
lilyball
commented
May 27, 2014
I think Given that, I would feel more comfortable removing |
Show impl for Tree{Map,Set}, add .reserve_additional, and cleanupShow impl for Tree{Map,Set} and cleanuperickt
commented
May 27, 2014
@kballard: I removed the |
There was a problem hiding this comment.
Eq is an unnecessary bound here. TreeMap only requires TotalOrd (which as it happens includes Eq via TotalEq).
I'm not convinced that we need extra bounds (like TotalOrd) at all on unrelated traits, since you can't even construct a TreeMap without TotalOrd, but precedent so far is to use the "required" bounds on all traits. So <K: TotalOrd + Show, V: Show> should be correct.
There was a problem hiding this comment.
Same thing about the Eq bound here.
lilyball
commented
May 27, 2014
r=me with comments |
erickt
commented
May 27, 2014
@kballard: I addressed your comments in the latest version. |
This is a hodge podge of a couple small cleanup commits. It implements `Show` for `TreeMap` and `TreeSet`, and some removal of commented out code.
changelog: [`neg_multiply`]: lint float numbers as well
This is a hodge podge of a couple small cleanup commits. It implements
ShowforTreeMapandTreeSet, and some removal of commented out code.