Paul Krill
Editor at Large

Rust 1.94 introduces array windows to iterate slices

news
Mar 5, 20262 mins

Latest release of the Rust programming language also brings include paths to Cargo configuration files.

A rusty crown sits on an anvil.
Credit: AL-art/Shutterstock

The Rust team has unveiled Rust 1.94. This release adds an array windows capability as an iterating method for the Rust slice type as well as improved management of Cargo configurations.

Rust 1.94 was announced March 5. Developers using a previous version can upgrade via rustup by running rustup update stable.

The array_windows method works just like windows but with a constant length, so iterator items are &[T; N] rather than dynamically-sized &[T]. In many cases, the window length may be inferred by how the iterator is used. Slices let developers reference a contiguous sequence of elements in a collection.

Cargo, the Rust package manager, now supports the include key in configuration files (.cargo/config.toml), for better organization, sharing, and management of Cargo configurations across environments and projects. These include paths may be marked optional if they might not be present in some circumstances.

Cargo now parses TOML v1.1 for manifests and configuration files. TOML, for Tom’s Obvious, Minimal Language, is intended to be a minimal configuration file format that is easy to read due to obvious semantics. Changes in TOML 1.1 include inline tables across multiple lines and with trailing commas, \xHH and \e string escape characters, and optional seconds in times. Using these features in Cargo.toml will raise development MSRV (minimum supported Rust version) to require the new Cargo parser, and third-party tools that read the manifest may also need to update their parsers. However, Cargo automatically rewrites manifests on publish to remain compatible with older parsers, so it is still possible to support an earlier MSRV.

Rust 1.94 also stabilizes 17 APIs. This month’s Rust release follows the January 22 release of Rust 1.93, which improved operations involving the DNS resolver for the musl implementation of the C standard library.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author