Rust 1.94: Array Windows Bring Easier Slice Iteration

Paul Krill
3 Min Read

The newest version of the Rust programming language introduces essential ‘include paths’ for Cargo configuration files.

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

The Rust development team has officially launched Rust 1.94. This update introduces an ‘array windows’ feature, enhancing iteration methods for the Rust slice type, and also brings significant improvements to Cargo configuration management.

Rust 1.94 was revealed on March 5th. Existing users can update to this stable version simply by executing rustup update stable through rustup.

The new array_windows method functions similarly to the windows method, but it operates with a fixed length, resulting in iterator items being &[T; N] instead of the dynamically-sized &[T]. Often, the required window length can be automatically determined from the iterator’s usage context. Slices enable programmers to efficiently access a continuous series of elements within a collection.

Cargo, Rust’s robust package manager, now incorporates support for the include key within its configuration files (.cargo/config.toml). This enhancement facilitates improved organization, sharing, and overall management of Cargo setups across various development environments and projects. Furthermore, these include paths can be designated as optional for scenarios where their presence isn’t guaranteed.

Cargo has upgraded its parser to support TOML v1.1 for both manifests and configuration files. TOML, an acronym for Tom’s Obvious, Minimal Language, is designed to be a straightforward and easily parsable configuration format with clear semantics. Key updates in TOML 1.1 encompass inline tables that span multiple lines and allow trailing commas, the introduction of \xHH and \e string escape characters, and the option to omit seconds in time values. Implementing these new TOML features within Cargo.toml will increase the development’s MSRV (minimum supported Rust version), necessitating the updated Cargo parser. Consequently, any third-party tools that process these manifests might also require parser updates. Despite this, Cargo intelligently rewrites manifests during publication to ensure backward compatibility with older parsers, thus allowing continued support for an earlier MSRV.

Additionally, Rust 1.94 stabilizes 17 distinct APIs. This current Rust version arrives on the heels of the Rust 1.93 release from January 22, which brought enhancements to DNS resolver operations specifically for the musl C standard library implementation.

Programming LanguagesRustSoftware Development
Share This Article
Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *