fix: unnecessary space
This commit is contained in:
parent
80efefae9e
commit
16e8f45ab8
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
### Char
|
### Char
|
||||||
1. 🌟
|
1. 🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
|
|
||||||
// Make it work
|
// Make it work
|
||||||
use std::mem::size_of_val;
|
use std::mem::size_of_val;
|
||||||
|
@ -18,7 +18,7 @@ fn main() {
|
||||||
```
|
```
|
||||||
|
|
||||||
2. 🌟
|
2. 🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
|
|
||||||
// Make it work
|
// Make it work
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -33,7 +33,7 @@ fn print_char(c : char) {
|
||||||
|
|
||||||
### Bool
|
### Bool
|
||||||
3. 🌟
|
3. 🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
|
|
||||||
// Make println! work
|
// Make println! work
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -47,7 +47,7 @@ fn main() {
|
||||||
```
|
```
|
||||||
|
|
||||||
4. 🌟
|
4. 🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
|
|
||||||
// Make it work
|
// Make it work
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -335,7 +335,7 @@ The `impl Trait` syntax works for straightforward cases but is actually syntax s
|
||||||
When working with generics, the type parameters often must use traits as bounds to stipulate what functionality a type implements.
|
When working with generics, the type parameters often must use traits as bounds to stipulate what functionality a type implements.
|
||||||
|
|
||||||
7. 🌟🌟
|
7. 🌟🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
fn main() {
|
fn main() {
|
||||||
assert_eq!(sum(1, 2), 3);
|
assert_eq!(sum(1, 2), 3);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ fn print_str(s: String) {
|
||||||
```
|
```
|
||||||
|
|
||||||
5. 🌟🌟
|
5. 🌟🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
// Don't use clone ,use copy instead
|
// Don't use clone ,use copy instead
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = (1, 2, (), "hello".to_string());
|
let x = (1, 2, (), "hello".to_string());
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
### 字符
|
### 字符
|
||||||
1. 🌟
|
1. 🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
// 修改2处 `assert_eq!` 让代码工作
|
// 修改2处 `assert_eq!` 让代码工作
|
||||||
|
|
||||||
use std::mem::size_of_val;
|
use std::mem::size_of_val;
|
||||||
|
@ -18,7 +18,7 @@ fn main() {
|
||||||
```
|
```
|
||||||
|
|
||||||
2. 🌟
|
2. 🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
// 修改一行让代码正常打印
|
// 修改一行让代码正常打印
|
||||||
fn main() {
|
fn main() {
|
||||||
let c1 = "中";
|
let c1 = "中";
|
||||||
|
@ -32,7 +32,7 @@ fn print_char(c : char) {
|
||||||
|
|
||||||
### 布尔
|
### 布尔
|
||||||
3. 🌟
|
3. 🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
|
|
||||||
// 使成功打印
|
// 使成功打印
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -46,7 +46,7 @@ fn main() {
|
||||||
```
|
```
|
||||||
|
|
||||||
4. 🌟
|
4. 🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let f = true;
|
let f = true;
|
||||||
|
|
|
@ -333,7 +333,7 @@ fn main() {
|
||||||
当使用泛型参数时,我们往往需要为该参数指定特定的行为,这种指定方式就是通过特征约束来实现的。
|
当使用泛型参数时,我们往往需要为该参数指定特定的行为,这种指定方式就是通过特征约束来实现的。
|
||||||
|
|
||||||
7. 🌟🌟
|
7. 🌟🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
fn main() {
|
fn main() {
|
||||||
assert_eq!(sum(1, 2), 3);
|
assert_eq!(sum(1, 2), 3);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ fn print_str(s: String) {
|
||||||
```
|
```
|
||||||
|
|
||||||
5. 🌟🌟
|
5. 🌟🌟
|
||||||
```rust, editable
|
```rust,editable
|
||||||
// 不要使用 clone,使用 copy 的方式替代
|
// 不要使用 clone,使用 copy 的方式替代
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = (1, 2, (), "hello".to_string());
|
let x = (1, 2, (), "hello".to_string());
|
||||||
|
|
Loading…
Reference in New Issue