Skip to content

Commit 6e3675c

Browse files
Merge pull request #401 from Librazy/revert-400-master
Revert "rm tail whitespaces"
2 parents d4a9117 + fdd6dd5 commit 6e3675c

3 files changed

Lines changed: 25 additions & 28 deletions

File tree

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,3 @@ jspm_packages
3939

4040
# Optional REPL history
4141
.node_repl_history
42-
43-
# Emacs Cache files
44-
.#*

quickstart/primitive-type.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ fn main() {
4242

4343
**例如:**
4444
固定大小类型:
45-
> 1u8 1i8
46-
> 1u16 1i16
47-
> 1u32 1i32
45+
> 1u8 1i8
46+
> 1u16 1i16
47+
> 1u32 1i32
4848
> 1u64 1i64
4949
5050
可变大小类型:
@@ -70,7 +70,7 @@ fn main() {
7070
assert_eq!(a, b);
7171
}
7272
```
73-
这里使用了 bool,只有 true 和 false 两个值,通常用来做逻辑判断的类型。
73+
这里使用了 bool,只有true和false两个值,通常用来做逻辑判断的类型。
7474

7575
## 原生类型
7676

quickstart/rust-travel.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
- 创建一个 Doing 目录和 helloworld.rs 文件
1010

11-
> ps: mkdir ~/Doing
12-
> ps: cd ~/Doing
13-
> ps: notepad helloworld.rs # 作者偏向于使用 sublime 作为编辑器
14-
> ps: subl helloworld.rs # 本章以后使用 subl 代替 notepad
11+
> ps: mkdir ~/Doing
12+
> ps: cd ~/Doing
13+
> ps: notepad helloworld.rs # 作者偏向于使用 sublime 作为编辑器
14+
> ps: subl helloworld.rs # 本章以后使用 subl 代替 notepad
1515
1616
注意这里用的后缀名是.rs,一般编程语言的代码文件都有惯用的后缀名,比如:
1717
C语言是.c,java是.java,python是.py等等,**请务必记住Rust语言的惯用后缀名是.rs**(虽然用别的后缀名也能通过rustc的编译)。
@@ -26,13 +26,13 @@ fn main() {
2626

2727
- 编译 helloworld.rs 文件
2828

29-
> ps: rustc helloworld.rs
30-
> ps: rustc helloworld.rs -O # 也可以选择优化编译
29+
> ps: rustc helloworld.rs
30+
> ps: rustc helloworld.rs -O # 也可以选择优化编译
3131
3232
- 运行程序
3333

34-
> ps: ./helloworld.exe # windows 平台下需要加 .exe 后缀
35-
> Hello World!
34+
> ps: ./helloworld.exe # windows 平台下需要加 .exe 后缀
35+
> Hello World!
3636
3737
没有`ps:`前缀的表示为控制台打印输出。
3838

@@ -53,20 +53,20 @@ fn main() {
5353
5454
- 查看目录结构
5555

56-
> ps: tree # win10 powershell 自带有 tree 查看文件目录结构的功能
57-
> └─hellorust
56+
> ps: tree # win10 powershell 自带有 tree 查看文件目录结构的功能
57+
> └─hellorust
5858
> ----└─src
5959
6060
这里显示的目录结构,在hellorust目录下有 src 文件夹和 Cargo.toml 文件,同时这个目录会初始化为 git 项目
6161

6262
- 查看Cargo.toml文件
6363

64-
> ps: cat Cargo.toml
65-
> [package]
66-
name = "hellorust"
67-
version = "0.1."
64+
> ps: cat Cargo.toml
65+
> [package]
66+
name = "hellorust"
67+
version = "0.1."
6868
authors = ["YourName <YourEmail>"]
69-
> [dependencies]
69+
> [dependencies]
7070
7171
- 编辑src目录下的main.rs文件
7272

@@ -90,9 +90,9 @@ fn main() {
9090

9191
- 编译和运行
9292

93-
> ps: cargo build
94-
> ps: cargo build --release # 这个属于优化编译
95-
> ps: ./target/debug/hellorust.exe
96-
> ps: ./target/release/hellorust.exe # 如果前面是优化编译,则这样运行
97-
> ps: cargo run # 编译和运行合在一起
98-
> ps: cargo run --release # 同上,区别是是优化编译的
93+
> ps: cargo build
94+
> ps: cargo build --release # 这个属于优化编译
95+
> ps: ./target/debug/hellorust.exe
96+
> ps: ./target/release/hellorust.exe # 如果前面是优化编译,则这样运行
97+
> ps: cargo run # 编译和运行合在一起
98+
> ps: cargo run --release # 同上,区别是是优化编译的

0 commit comments

Comments
 (0)