Johan Milanov

Results 10 comments of Johan Milanov

I think it would also be useful to be able to drain a vector by mapping a function that takes each item by value and decides whether to yield a...

You're right, perhaps it would be clearer with a different return type for the callback, with enum variants named something like `Take` or `PutBack`. It is unfortunate to have to...

@the8472 That consumes the entire original vector instead of only removing certain elements.

If you choose to collect the remaining elements then you'll lose the other elements—or you could do it the other way around. Either way you lose one half of the...

I suppose I should turn my proposal into a separate issue, I don't have much experience with RFCs and only added it here since it seemed somewhat related. To clarify,...

The actual drain internals use some unsafe trickery where they decrease the length of the vector before creating the iterator and then use some raw reads, which seem to be...

> ```rust > let len = line.chars().fold(0, |mut acc, i| {acc += i.len_utf8(); acc }); > ``` Isn't that simply `line.len()`?

Do you really want a newtype wrapper without any restrictions on accessing the underlying type? For example, should it be valid to add `Millimeter` to `u32` or raise a number...

This proposal does not make sense, since, AFAIK, no mainstream CPU supports atomic vector operations other than plain loads and stores—this feature cannot be added to Zig since it requires...

Maybe one step towards this could be the ability to specify a list of zip files to automatically add to the jar? This would at least let you install the...