mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 12:39:42 +00:00
Merge branch 'master' of https://github.com/sunface/rust-by-practice into editing
This commit is contained in:
@ -17,7 +17,7 @@
|
|||||||
[](https://github.com/sunface/rust-by-practice/blob/master/LICENSE)
|
[](https://github.com/sunface/rust-by-practice/blob/master/LICENSE)
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
This book was designed for easily diving into and get skilled with Rust, and it's very easy to use: All you need to do is to make each exercise compile without ERRORS and Panics !
|
This book was designed for easily diving into and getting skilled with Rust It's very easy to use. All you need to do is to make each exercise compile without ERRORS and Panics!
|
||||||
|
|
||||||
|
|
||||||
## Reading online
|
## Reading online
|
||||||
|
@ -99,7 +99,7 @@ fn main() {
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Unused variables
|
### Unused variables
|
||||||
1. Fix the warning below with :
|
7. Fix the warning below with :
|
||||||
|
|
||||||
- 🌟 Only one solution
|
- 🌟 Only one solution
|
||||||
- 🌟🌟 Two distinct solutions
|
- 🌟🌟 Two distinct solutions
|
||||||
|
@ -52,7 +52,7 @@ fn never_return() -> ! {
|
|||||||
// implement this function, don't modify fn signatures
|
// implement this function, don't modify fn signatures
|
||||||
loop {
|
loop {
|
||||||
println!("I return nothing");
|
println!("I return nothing");
|
||||||
// sleeping for 1 second to avoid exhausting the cpu resoucre
|
// sleeping for 1 second to avoid exhausting the cpu resource
|
||||||
thread::sleep(time::Duration::from_secs(1))
|
thread::sleep(time::Duration::from_secs(1))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ fn main() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
println!("Excercise Failed if printing out this line!");
|
println!("Exercise Failed if printing out this line!");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -26,7 +26,10 @@
|
|||||||
$ cargo install mdbook
|
$ cargo install mdbook
|
||||||
$ cd rust-by-practice && mdbook serve
|
$ cd rust-by-practice && mdbook serve
|
||||||
```
|
```
|
||||||
|
在本地win 10或者linux服务器上运行时,应当使用 -n 参数指定mdbook服务所监听的IP地址(-p 参数指定服务监听的端口,不指定则为默认的3000),以win 10本地运行为例:
|
||||||
|
```shell
|
||||||
|
$ mdbook serve -p 8888 -n 127.0.0.1
|
||||||
|
```
|
||||||
## 特性
|
## 特性
|
||||||
|
|
||||||
部分示例和习题借鉴了 [Rust By Example](https://github.com/rust-lang/rust-by-example), 书中的示例真的非常棒!
|
部分示例和习题借鉴了 [Rust By Example](https://github.com/rust-lang/rust-by-example), 书中的示例真的非常棒!
|
||||||
|
Reference in New Issue
Block a user