ITPub博客

首页 > 数据库 > 数据库开发技术 > 【Rust日报】2021-09-10 Rust 1.55 稳定版发布

【Rust日报】2021-09-10 Rust 1.55 稳定版发布

原创 数据库开发技术 作者:Rust语言中文社区 时间:2021-09-10 23:03:34 0 删除 编辑

Rust 1.55 稳定版发布

Rust 1.55 是 2021 Edition 正式发布之前的倒数第二个版本,此版本主要更新如下:
  • range 操作符支持半开语法
match x as u32 {
0 => println!("zero!"),
1.. => println!("positive number!"),
}
  • 极大的提高浮点数的解析速度
采用新的 Eisel-Lemire 算法解析浮点数,不仅在速度上有很大提升,之前一些解析失败的边缘 case 也全都修复了
  • cargo 构建的时候不再重复报 Error
  • 细化 io::ErrorKind
使用 ErrorKind::Other 来区分标准库之外产生的 io Error,标准库之内不会再产生 ErrorKind::Other 的 Error。标准库未来暂未分类的 Error 类型,统一使用 Uncategorized。
  • 数组增加 map() 方法
数组的 map() 方法返回的依然是数组,对数组来说更方便!
  • 稳定 ops::ControlFlow
这是未来要稳定的 try trait v2 的一部分。
pub enum ControlFlow<B, C = ()> {
Continue(C),
Break(B),
}
标准库里面很多地方都用到了这个类型,很有用。
  • cargo clippy --fix 可以自动帮你修复 clippy 的警告
这个非常赞!
链接:https://blog.rust-lang.org/2021/09/09/Rust-1.55.0.html

纪念 Anna Harren

Anna Harren 是第一个将 Rust 的 ::<> 语法命名为 Turbofish 的人。
Rust 官方发布 1.55 的时候在博客里还特意纪念了最近刚去世的 Anna Harren。
链接:https://twitter.com/garblefart/status/627886036211900416

Rustaceans 准则

Niko 发布了一篇博客,总结出 Rustaceans 的准则,比如其中提到:
Rust empowers by being…
  • ⚙️ Reliable: “if it compiles, it works”
  • 🐎 Performant: “idiomatic code runs efficiently”
  • 🥰 Supportive: “the language, tools, and community are here to help”
  • 🧩 Productive: “a little effort does a lot of work”
  • 🔧 Transparent: “you can predict and control low-level details”
  • 🤸 Versatile: “you can do anything with Rust”
How to Rustacean
  • 💖 Be kind and considerate
  • ✨ Bring joy to the user
  • 👋 Show up
  • 🔭 Recognize others’ knowledge
  • 🔁 Start somewhere
  • ✅ Follow through
  • 🤝 Pay it forward
  • 🎁 Trust and delegate
链接:https://smallcultfollowing.com/babysteps//blog/2021/09/08/rustacean-principles/
-- From 日报小组 Folyd, 侯盛鑫
社区学习交流平台订阅:
  • Rustcc论坛: 支持rss
  • 微信公众号:Rust语言中文社区

原文作者:Rust语言中文社区;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论

注册时间:2020-06-11

  • 博文量
    1769
  • 访问量
    718615