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".

rust

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.

rust

 

More Information

Rust Website

Related Articles

Rust 1.50 Improves Array Indexing

Rust Team Announces Rust Foundation

Rust Survey 2020

Amazon AWS Invests In Rust

Rust 2018 Released To Improve Developer Productivity

Rust Survey Revelations

Rust 1.28 Improves Memory Use

Rust 1.26 Adds Existential Types

Rust 1.24 Adds Reformatter

Rust 1.23 Uses Less Memory

Rust 1.20 Adds Associated Contents

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


.NET 6 Preview 6 Improves Pre-Compilation
22/07/2021

Microsoft has released .NET 6 Preview 6, the second to last preview before the RC period. The new preview has been tested for Visual Studio 2022, Preview 2, and has added improved pre-compilation hand [ ... ]



Developers At Work 2021
16/07/2021

The report on the latest JetBrains Developer Ecosystem Survey is out and is packed full of interesting data. Since the weekend is upon us we'll postpone consideration of its finding about program [ ... ]


More News

square

 



 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Thursday, 24 June 2021 )