Programming language: rust 1.53 allowed unicode for identifier

Programming language: rust 1.53 allowed unicode for identifier

In the anti-six-week rhythm is Rust 1.53 published. The new version implements the intointerator trait for arrays and allows nested or patterns. In addition, the identifier now contains Unicode characters. For the package registry cargo there is an episis in the interest of non-racist language.

Numbers without reference

After Rust 1.51 The API STD :: ARRAY :: Intoiter for iterating UBER Arrays by Value instead of by Reference has introduced Arrays in the current release the Trait Intoiterator. Thus, the direct iteration on Arrays by Value is possible in the following form possible:

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

So far, developers and developers had to perform iterating by Reference and either [1, 2, 3] or the method call [1, 2, 3].Use iter (). With the implementation of the trait, it is allowed to give arrays on methods that expect as parameters T: Intoiterator. Currently, a workaround is required under the hood, which should be eliminated with the implementation in Rust 2021.

Characters, but no emoji for identifiers

Identifier were only allowed to consist of ASCII characters. The current release allows any Unicode characters based on Unicode 13. The compiler spits a warning for signs that can be seen each other and thus lead to confusion. Who believes to print subtil in his opinion via variables over Emojis, will be destroyed: these are still prohibited within identifiers. The use of Asian and European special characters shows the following example from the Rust Blog:

const Blåhaj: STR = "# 129416;"; Struct 人 {名字: String,} Let α = 1;

The Rust team has also extended the pattern syntax. It now allows the nested OR link over |, so that Some (1 | 2) as an alternative to Some (1) | Some (2) is allowed.

In addition to the innovations, the release stabilizes numerous APIs, including Arrays next to the Intoiterator Trait the APIs Array :: from_ref and Array :: from_mut.

It is also appreciable that the package registry cargo recently expects no more master as standard as standard head for git repositories. Thus, for the repositories, which already use in the course of the conversion to non-sales language instead of masters for the main branch, the explicit specification of Branch = "Main".

More details about Rust 1.53 can be found in the rust blog. The complete list of changes and innovations can be found in the Release Notes. How to download developers who have already installed Rust already download the current release Uber Rustup Update Stable. For those who do not yet use Rust, the rustup tool is available on the download page separately.

Like this post? Please share to your friends:
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: