Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
cfe08b74
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cfe08b74
编写于
4月 25, 2015
作者:
M
Manish Goregaokar
浏览文件
操作
浏览文件
下载
差异文件
Rollup merge of #24806 - FuGangqiang:doc, r=Manishearth
上级
4f1bbc20
46462c7b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
10 deletion
+10
-10
src/doc/trpl/getting-started.md
src/doc/trpl/getting-started.md
+1
-1
src/doc/trpl/glossary.md
src/doc/trpl/glossary.md
+1
-1
src/doc/trpl/primitive-types.md
src/doc/trpl/primitive-types.md
+7
-7
src/doc/trpl/variable-bindings.md
src/doc/trpl/variable-bindings.md
+1
-1
未找到文件。
src/doc/trpl/getting-started.md
浏览文件 @
cfe08b74
% Getting Started
This first section of the book will get you going with Rust and its tooling.
First, we’ll install Rust. Then
:
the classic ‘Hello World’ program. Finally,
First, we’ll install Rust. Then
,
the classic ‘Hello World’ program. Finally,
we’ll talk about Cargo, Rust’s build system and package manager.
src/doc/trpl/glossary.md
浏览文件 @
cfe08b74
...
...
@@ -19,7 +19,7 @@ In the example above `x` and `y` have arity 2. `z` has arity 3.
When a compiler is compiling your program, it does a number of different
things. One of the things that it does is turn the text of your program into an
'abstract syntax tree,' or 'AST.'
This tree is a representation of the
‘abstract syntax tree’, or‘AST’.
This tree is a representation of the
structure of your program. For example,
`2 + 3`
can be turned into a tree:
```
text
...
...
src/doc/trpl/primitive-types.md
浏览文件 @
cfe08b74
...
...
@@ -62,14 +62,14 @@ let y = 1.0; // y has type f64
Here’s a list of the different numeric types, with links to their documentation
in the standard library:
*
[
i8
](
../std/primitive.i8.html
)
*
[
i16
](
../std/primitive.i16.html
)
*
[
i32
](
../std/primitive.i32.html
)
*
[
i64
](
../std/primitive.i64.html
)
*
[
i8
](
../std/primitive.i
8.html
)
*
[
u8
](
../std/primitive.u
8.html
)
*
[
u16
](
../std/primitive.u16.html
)
*
[
u32
](
../std/primitive.u32.html
)
*
[
u64
](
../std/primitive.u64.html
)
*
[
u8
](
../std/primitive.u8.html
)
*
[
isize
](
../std/primitive.isize.html
)
*
[
usize
](
../std/primitive.usize.html
)
*
[
f32
](
../std/primitive.f32.html
)
...
...
@@ -82,12 +82,12 @@ Let’s go over them by category:
Integer types come in two varieties: signed and unsigned. To understand the
difference, let’s consider a number with four bits of size. A signed, four-bit
number would let you store numbers from
`-8`
to
`+7`
. Signed numbers use
‘two’s compliment representation’
. An unsigned four bit number, since it does
“two’s compliment representation”
. An unsigned four bit number, since it does
not need to store negatives, can store values from
`0`
to
`+15`
.
Unsigned types use a
`u`
for their category, and signed types use
`i`
. The
`i`
is for ‘integer’. So
`u8`
is an eight-bit unsigned number, and
`i8`
is an
eight-bit signed number.
eight-bit signed number.
## Fixed size types
...
...
@@ -103,7 +103,7 @@ and unsigned varieties. This makes for two types: `isize` and `usize`.
## Floating-point types
Rust also
two floating point types:
`f32`
and
`f64`
. These correspond to
Rust also
has two floating point types:
`f32`
and
`f64`
. These correspond to
IEEE-754 single and double precision numbers.
# Arrays
...
...
@@ -241,8 +241,8 @@ println!("x is {}", x);
Remember
[
before
][
let
]
when I said the left-hand side of a
`let`
statement was more
powerful than just assigning a binding? Here we are. We can put a pattern on
the left-hand side of the
`let`
, and if it matches up to the right-hand side,
we can assign multiple bindings at once. In this case,
`let`
"destructures,"
or
"breaks up,"
the tuple, and assigns the bits to three bindings.
we can assign multiple bindings at once. In this case,
`let`
“destructures”
or
“breaks up”
the tuple, and assigns the bits to three bindings.
[
let
]:
variable-bindings.html
...
...
src/doc/trpl/variable-bindings.md
浏览文件 @
cfe08b74
% Variable Bindings
Vi
tually every non-’Hello World’
Rust program uses
*variable bindings*
. They
Vi
rtually every non-‘Hello World’
Rust program uses
*variable bindings*
. They
look like this:
```
rust
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录