Wrote a quick new crate today: slice-fill. Fills a slice with a value; easier to write than writing a manual loop. Might actually want to propose this for std since for u8/u16 it already optimizes to a memset(3), which is very fast already. https://docs.rs/slice-fill/1.0.1/slice_fill/index.html …
heh, interesting. Didn't know both methods existed with potential perf implications. TIL, thanks for sharing!
-
-
Yeah! If specialization was possible, I would think it would be possible to offer one method with two impls (Copy if possible, Clone if !Copy), but it certainly wasn't there at Rust 1.9, and isn't quite there yet AFAIK.
-
libstd can definitely use specialization to make things faster when that makes sense
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.