|Rust 1.53 Adds IntoIterator|
|Written by Alex Denham|
|Thursday, 24 June 2021|
Rust 1.53 has been released with new support for the use of IntoIterator for arrays. This allows developers to iterate over arrays by value.
Rust's strengths for situations such as being embedded in other languages, writing programs with specific space and time requirements, and writing low-level code has driven its popularity, and its development is now safeguarded by the Rust Foundation, a cross-industry body aimed at supporting the language and its developers. This update follows the announcement by the development team that the Rust 2021 edition is due for release in October with:
"a number of small changes that are nonetheless expected to make a significant improvement to how Rust feels in practice".
The ability to use IntoIterator over arrays by value hasn't been implemented in earlier versions to avoid backwards compatibility problems. IntoIterator was already implemented for references to arrays, so array.into_iter() resolved to (&array).into_iter().
The developers have now added a small workaround to avoid breaking code, which will be removed in the new edition, Rust 2021, due to be released later this year. The workaround provides arrays with what the developers refer to as an IntoIterator trait that the compiler uses to deal with them correctly.
Or patterns have also been improved, and the pattern syntax now supports | nested anywhere in the pattern. This means developers can specify a pattern using the | operator inside pattern matches instead of on complete patterns only, so you can write Some(1 | 2) instead of Some(1) | Some(2).
Other improvements include the ability for Unicode identifiers to now contain non-ascii characters, HEAD branch name support in Cargo so that Cargo no longer assumes the default HEAD of git repositories is named master, and a long list of stabilised methods and trait implementations in APIs.
Rust 1.53 is available now.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Thursday, 24 June 2021 )|