1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

新闻 Rust 1.17 发布,Mozilla 的编程语言 下载

Discussion in '软件资讯' started by 漂亮的石头, 2017-04-28.

  1. 漂亮的石头

    漂亮的石头 版主 Staff Member

    Joined:
    2012-02-10
    Messages:
    487,979
    Likes Received:
    47
    Rust 1.17 发布了。Rust 是一门由 Mozilla 开发的专注于安全性,速度和并发性的系统编程语言。

    总的来说,Rust 1.17.0 的主要更新是小幅度提高了写代码的效率。例如,'static 的生命周期现在假设在 statics 和 consts。当像这样写一个 const 或 static 时:

    const NAME: &'static str = "Ferris";
    static NAME: &'static str = "Ferris";


    Rust 1.17 将允许你去除 'static,因为这里只有唯一一个生命周期有意义

    const NAME: &str = "Ferris";
    static NAME: &str = "Ferris";


    在某些情况下,这可以清除大量的样板代码:

    // old
    const NAMES: &'static [&'static str; 2] = &["Ferris", "Bors"];

    // new
    const NAMES: &[&str; 2] = &["Ferris", "Bors"];


    本次的更新内容较多,可点击下面的链接参阅详细信息。

    发布主页发行日志

    下载地址

    Rust 1.17 发布,Mozilla 的编程语言下载地址
     
Loading...