Rust 1.53.0: IntoIterator for arrays, "|" in templates, Unicode identifiers, support for HEAD branch name in Cargo

The Rust team is pleased to announce the release of a new version - 1.53.0. Rust is a programming language that allows anyone to create reliable and efficient software.







If you installed a previous version of Rust using tools rustup



, then to upgrade to version 1.53.0, you just need to run the following command:







rustup update stable
      
      





If you don't already have it rustup



, you can install it from the appropriate page on our website, as well as view the detailed release notes on GitHub.







What was stabilized in 1.53.0



This release contains several new features for the language and even more for the standard library, including the long-awaited implementation IntoIterator



for arrays. See the detailed release notes for other changes not covered in this announcement.







IntoIterator



for arrays



This is the first Rust release in which arrays implement a trait IntoIterator



. Now you can iterate through the array by value:







for i in [1, 2, 3] {
    ..
}
      
      





Previously, this was only possible by reference, using &[1, 2, 3]



or [1, 2, 3].iter()



.







Similarly, you can now pass an array to methods that expect T: IntoIterator



:







let set = BTreeSet::from_iter([1, 2, 3]);
      
      





for (a, b) in some_iterator.chain([1]).zip([1, 2, 3]) {
    ..
}
      
      





- . IntoIterator



โ€” array.into_iter()



, (&array).into_iter()



.







, IntoIterator



. , , array.into_iter()



(&array).into_iter()



, . .into_iter()



, , for e in [1, 2, 3]



, iter.zip([1, 2, 3])



IntoIterator::into_iter([1, 2, 3])



, .







.into_iter()



, Rust 2021, . โ€” .







""



|



, . Some(1 | 2)



Some(1) | Some(2)



.







match result {
     Ok(Some(1 | 2)) => { .. }
     Err(MyError { kind: FileNotFound | PermissionDenied, .. }) => { .. }
     _ => { .. }
}
      
      





Unicode-



-ASCII . Unicode, UAX #31. โ€” .







:







const BLร…HAJ: &str = "";

struct ไบบ {
    ๅๅญ—: String,
}

let ฮฑ = 1;
      
      





. , , , :







warning: identifier pair considered confusable between `๏ฝ“` and `s`
      
      





HEAD- Cargo



Cargo , HEAD



- git- master



. , branch = "main"



git-, main



.









1.52.1, Rust. beta nightly. 1.53.0 1.52.1.







API



:











, Cargo Clippy .







1.53.0



, Rust 1.53.0. . !












Rust - . , .

OpenCollective.







TelegaOvoshey, blandger, Belanchuk and funkill...








All Articles