↑↑↓↓←→←→ⒷⒶ Войти !bnw Сегодня Клубы
https://blog.rust-lang.org/2017/11/22/Rust-1.22.html "What’s in 1.22.0 and 1.22.1 stable The headline feature for this release is one many have been anticipating for a long time: you can now use ? with Option<T>! About a year ago, in Rust 1.13, we introduced the ? operator for working with Result<T, E>. Ever since then, there’s been discussion about how far ? should go: should it stay only for results? Should it be user-extensible? Should it be usable with Option<T>? In Rust 1.22, basic usage of ? with Option<T> is now stable. This code will now compile: fn try_option_some() -> Option<u8> { let val = Some(1)?; Some(val) } assert_eq!(try_option_some(), Some(1)); fn try_option_none() -> Option<u8> { let val = None?; Some(val) } assert_eq!(try_option_none(), None); However, this functionality is still a bit limited; you cannot yet write code that mixes results and options with ? in the same function, for example. This will be possible in the future, and already is in nightly Rust; expect to hear more about this in a future release. Types that implement Drop are now allowed in const and static items. Like this: struct Foo { a: u32 } impl Drop for Foo { fn drop(&mut self) {} } const F : Foo = Foo { a : 0 }; static S : Foo = Foo { a : 0 }; This change doesn’t bring much on its own, but as we improve our ability to compute things at compile-time, more and more will be possible in const and static. Additionally, some small quality-of-life improvements: Two recent compiler changes should speed up compiles in debug mode. We don’t have any specific numbers to commit to with these changes, but as always, compile times are very important to us, and we’re continuing to work on improving them. T op= &T now works for primitive types, which is a fancy way of saying: let mut x = 2; let y = &8; // this didn&#39;t work, but now does x += y; Previously, you’d have needed to write x += *y in order to de-reference, so this solves a small papercut."
Рекомендовали: @noleg_pidor_i_sosal
#6P73I3 / @o01eg / 2549 дней назад

угадал язык по последнему абзацу, рейт ми бнв

#6P73I3/A67 / @goren / 2549 дней назад
ipv6 ready BnW для ведрофона BnW на Реформале Викивач Котятки

Цоперайт © 2010-2016 @stiletto.