Announcing Rust 1.94.0
The Rust team is happy to announce a new version of Rust, 1.94.0. Rust is a programming language empowering everyone to build reliable and efficient software. If you have a previous version of Rust installed via rustup , you can get 1.94.0 with: $ rustup update stable If you don't have it already, you can get rustup from the appropriate page on our website, and check out the detailed release notes for 1.94.0 . If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel ( rustup default beta ) or the nightly channel ( rustup default nightly ). Please report any bugs you might come across! What's in 1.94.0 stable Array windows Rust 1.94 adds array_windows , an iterating method for slices. It works just like windows but with a constant length, so the iterator items are &[T; N] rather than dynamically-sized &[T] . In many cases, the window length may even be inferred by how the iterator is used! For example, part of one 2016 Advent of Code puzzle is looking for ABBA patterns: "two different characters followed by the reverse of that pair, such as xyyx or abba ." If we assume only ASCII characters, that could be written by sweeping windows of the byte slice like this: fn has_abba ( s : & str ) -> bool { s . as_bytes ( ) . array_windows ( ) . any ( | [ a1 , b1 ,

The Rust team has announced the release of Rust 1.94.0, a new version of the programming language designed to empower developers to build reliable and efficient software. For users who have previously installed Rust using rustup, updating to the latest stable version can be done with the command: `rustup update stable`. Those who do not have rustup installed can obtain it from the appropriate page on the Rust website. Detailed release notes for Rust 1.94.0 are available for reference.
To help the Rust team with future releases, developers are encouraged to test them by updating their local setup to use the beta channel with `rustup default beta` or the nightly channel with `rustup default nightly`. Any bugs encountered during testing should be reported to the team.
One of the key features of Rust 1.94.0 is the addition of `array_windows`, an iterating method for slices. This method works similarly to the existing `windows` iterator but with a constant length, producing iterator items of type `&[T; N]` rather than dynamically-sized `&[T]`. In many cases, the window length can be inferred by how the iterator is used, simplifying code and improving readability.
For example, in a 2016 Advent of Code puzzle, the task was to find ABBA patterns, such as "two different characters followed by the reverse of that pair, such as xyyx or abba." Assuming only ASCII characters, this could be achieved by sweeping windows of the byte slice. Using the new `array_windows` method, the solution can be written concisely as:
```rust
fn has_abba(s: &str) -> bool {
s.as_bytes().array_windows().any(|[a1, b1, b2, a2]| {
a1 != b1 && a1 == a2 && b1 == b2
})
}
```
The destructuring argument pattern in the closure allows the compiler to infer that windows of length 4 are required, eliminating the need to manually index a slice and optimizing runtime bounds-checking.
Another significant addition in Rust 1.94.0 is the inclusion of the `include` key in Cargo configuration files (`.cargo/config.toml`). This feature enables better organization, sharing, and management of Cargo configurations across projects and environments. Include paths can also be marked as optional, indicating that they might not be present in all scenarios.
Overall, Rust 1.94.0 continues to enhance the language's capabilities, providing developers with powerful tools to create efficient and reliable software. The new features, such as `array_windows` and improved Cargo configuration management, further solidify Rust's position as a popular choice for developers seeking to build high-performance applications.










