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


The Appeal of Google Summer of Code
21/03/2024

With the list of participating organizations now published, it is time for would-be contributors to select among them and apply for Google Summer of Code (GSoC). Rust has joined in the program fo [ ... ]



JetBrains Launches IDE Services
09/04/2024

JetBrains has launched a new product suite for enterprises. JetBrains IDE Services is designed for use by large organizations with the aim of boosting developer productivity at scale.


More News

raspberry pi books

 

Comments




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

Last Updated ( Thursday, 24 June 2021 )