Rust 1.17 发布,Mozilla 的编程语言

栏目: 编程语言 · Rust · 发布时间: 8年前

内容简介:Rust 1.17 发布,Mozilla 的编程语言

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"];

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

发布主页 发行日志

下载地址


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Ruby for Rails

Ruby for Rails

David Black / Manning Publications / 2006-05-11 / USD 44.95

What's Inside * How Ruby and Rails work, separately and together * Extensive Ruby language tutorial * Ruby techniques for Rails applications * Explore the Rails framework source code A new level of pr......一起来看看 《Ruby for Rails》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具