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

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.

主站蜘蛛池模板: 平南县| 五家渠市| 乌兰察布市| 惠来县| 白河县| 宜兰市| 景谷| 绥德县| 赞皇县| 丹巴县| 云浮市| 商丘市| 五河县| 台中县| 乃东县| 阿拉善右旗| 五河县| 申扎县| 英山县| 隆化县| 自治县| 辉南县| 台东县| 赤水市| 长治县| 仙桃市| 彰武县| 上栗县| 大方县| 乳源| 德钦县| 扬州市| 三台县| 阳泉市| 赤峰市| 丰城市| 保靖县| 东安县| 巴塘县| 吉木乃县| 乌拉特前旗|