News for hackers. Stuff that matters.
Re:Unsafe at Any Speed: Tradeoffs and Values in the Rust Eco... by LegionMammal978 on Thursday January 25, 2024 @07:36PM (#39137474)
These days, stripping fixed-length prefixes and suffixes off of slices is pretty easy with slice patterns. But that code was originally written around the time of Rust 1.0.0, when the language and standard library had far fewer features to help with this. For instance, it uses slice::from_raw_parts() rather than slice.get_unchecked(pos..), since the latter wasn't stable until Rust 1.15.0. Similarly, split_first() wasn't stable until Rust 1.5.0, and slice patterns weren't stable until Rust 1.26.0.

There are no comments on this comment yet.