Unlike the seek() function from the Seek trait, this one does not return the current position in the stream, which allows the BufReader to perform the seek without accessing the underlying reader if the new position lies within the buffer.
6. NonZero*::leading_zeros() and NonZero*::trailing_zeros()
These avoid the zero-check that the same functions on the regular integer types need to do, since on many architectures, the corresponding native instruction doesn't handle the zero case.
These are both `const fn`s.
7. std::array::from_ref and std::array::from_mut
These can safely convert a &T to &[T; 1] or &mut T to &mut [T; 1].
8. f32::is_subnormal and f64::is_subnormal
A way to easily check if a floating point number is subnormal.
9. DebugStruct::finish_non_exhaustive()
This allows you to mark the custom Debug representation of your type with fmt.debug_struct() to not be exhaustive. It adds two dots before the closing brace.
We've also updated the std types' Debug impls to consistently use this.
10. AtomicPtr::fetch_update and AtomicBool::fetch_update
We already had this one on the other atomic types, but they were missing on atomic pointers and booleans.
11. Peekable::peek_mut()
This allows you to mutate the peeked value which will be returned next by the Iterator.
I just approved the PR for a very exciting addition to @rustlang 1.53: IntoIterator for arrays 🎉🦀
Before this change, only references to arrays implemented IntoIterator, which meant you could iterate over &[1,2,3] and &mut [1,2,3], but not over [1,2,3] directly.
1/6
The reason we didn't add it sooner was backwards compatibility. `array.into_iter()` already compiles today, because of the way methods get resolved in Rust. This implicitly calls `(&array).into_iter()`. Adding the trait implementation would change the meaning and break code.
2/6
Technically we consider this type of breakage (adding a trait impl) 'minor' and acceptable. But there was too much code that would be broken by it. Thanks to @LukasKalbertodt, such code results in a warning nowadays, but there's a lot of code that just doesn't get updated.