官术网_书友最值得收藏!

Literal expressions

The simplest of Rust's expressions are the ones where we just write out the representation of the value we want. For example, when Rust sees 2 it knows we are asking it for the number 2. Similarly, when Rust sees "Hello, world!" it knows we're asking it to produce the sequence of letters that spells out Hello, world!

Rust recognizes the following literal expressions:

  • Numbers
  • Quoted text
  • Byte sequences
  • Single Unicode points
  • Single bytes
  • Boolean values

Numbers can be written as integers or decimal numbers or in engineering notation, and there are a few variants for quoted text and byte sequences, too. Boolean values are written as either true or false. In this book, we're not going to need any of the variants of quoted text, and we won't need byte sequences at all, so we won't go into those in more detail. See https://doc.rust-lang.org/ if you're curious.

主站蜘蛛池模板: 化德县| 抚顺市| 清徐县| 万全县| 武功县| 基隆市| 蓝田县| 郯城县| 侯马市| 巩留县| 赣榆县| 隆林| 新源县| 泰兴市| 宜黄县| 江陵县| 富裕县| 平度市| 嘉兴市| 武隆县| 上饶县| 凉城县| 额济纳旗| 临沭县| 南郑县| 腾冲县| 东乌| 大理市| 富蕴县| 甘孜县| 浦东新区| 西宁市| 秭归县| 平南县| 巴马| 任丘市| 土默特左旗| 双流县| 岚皋县| 得荣县| 鹿邑县|