Peter Jaszkowiak

Results 182 comments of Peter Jaszkowiak

One thought I had was to add a new trait for infallible write-to-string in the prelude: ```rust mod prelude { pub trait WriteStringInfallible { fn write_fmt(&mut self, args: std::fmt::Arguments) {...

I've been giving this a lot of thought over the last few days. At first, I really liked @dbdr's idea: > Could the `#` modifier apply only to the closest...

For what it's worth, I prefer `removed` or `deleted`. As for splitting into two methods, what is the internal representation currently? Is it a single collection for both or multiple...

I think returning an iterator makes a lot more sense. You can always collect it into a map. Plus that way you get to choose the kind of map you...

In most cases, don't people want to perform some sort of operation on the overlapping region? Could the function return a range instead? Then you could use `Range::is_empty` to just...

> Hmm, `intersect` probably wants different return types depending on the input ranges, not just an `impl RangeBounds`. > > Is it reasonable to mix the types? I guess `Range...

Add an outsider, it's pretty intuitive to me that any "saturating" operation applies to the result, not the operands.

I see. That's a very good point then. On the one hand, people will often expect the following to be equal: ```rust foo.saturating_mul(2) foo.saturating_shl(1) ``` But people will also expect...

Having the conditional inside the loop is problematic for performance. It's better to split the last element off before the loop: ```rust let most = &elements[..elements.len()-1]; let last = &elements[elements.len()-1];...