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


Firefox 1.0 Released 20 Years Ago
10/11/2024

A news item with the headline "Firefox browser takes on Microsoft" from 20 years ago has attracted renewed attention. It was originally published on the BBC News website on November 9th, 2004 rec [ ... ]



Ai-Da's Portrait of Alan Turing At Auction
01/11/2024

Sotheby's Digital Art Day Action, now underway, features a large-scale portrait of  Alan Turing created by Ai-Da, the humanoid robot artist whose work, including this canvas, was exhibited at the [ ... ]


More News

espbook

 

Comments




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

Last Updated ( Thursday, 24 June 2021 )