add solutions for variables
This commit is contained in:
parent
47d37b6940
commit
258f0ed589
|
@ -88,3 +88,5 @@ fn main() {
|
|||
assert!(size_of_val(&unit) == 4);
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -41,3 +41,5 @@ fn never_return() -> ! {
|
|||
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -163,3 +163,5 @@ fn main() {
|
|||
println!("0x80 >> 2 is 0x{:x}", 0x80u32 >> 2);
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -57,3 +57,5 @@ fn sum(x: i32, y: i32) -> i32 {
|
|||
x + y;
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -87,3 +87,4 @@ fn main() {
|
|||
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -70,7 +70,7 @@ fn main() {
|
|||
}
|
||||
```
|
||||
|
||||
🌟🌟 使用枚举对类型进行同一化
|
||||
🌟🌟
|
||||
|
||||
```rust,editable
|
||||
|
||||
|
@ -199,3 +199,5 @@ fn main() {
|
|||
println!("{}", list.stringify());
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -86,3 +86,5 @@ fn first_word(s: &str) -> &str {
|
|||
&s[..1]
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -251,5 +251,4 @@ fn main() {
|
|||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -214,3 +214,5 @@ fn main() {
|
|||
println!("{}, {}, {:?}",f.name, f.data, f);
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -75,3 +75,5 @@ fn sum_multiply(nums: (i32, i32)) -> (i32, i32) {
|
|||
(nums.0 + nums.1, nums.0 * nums.1)
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -243,3 +243,5 @@ fn main() {
|
|||
assert!(count == __)
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -164,3 +164,5 @@ fn main() {
|
|||
// you can't use r1 and r2 at the same time
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -161,3 +161,6 @@ fn main() {
|
|||
println!("{:?}, {:?}, {:?}", s1, s2, t);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -193,3 +193,6 @@ fn main() {
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -96,3 +96,5 @@ fn main() {
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -144,3 +144,6 @@ fn main() {
|
|||
assert_eq!([x,y], __);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it
|
|
@ -85,3 +85,5 @@ fn main() {
|
|||
assert!(size_of_val(&unit) == 4);
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -41,3 +41,5 @@ fn never_return() -> ! {
|
|||
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -163,3 +163,5 @@ fn main() {
|
|||
println!("0x80 >> 2 is 0x{:x}", 0x80u32 >> 2);
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -57,3 +57,5 @@ fn sum(x: i32, y: i32) -> i32 {
|
|||
x + y;
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -83,3 +83,4 @@ fn main() {
|
|||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -190,3 +190,5 @@ fn main() {
|
|||
println!("{}", list.stringify());
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -88,3 +88,5 @@ fn first_word(s: &str) -> &str {
|
|||
&s[..1]
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -255,4 +255,4 @@ fn main() {
|
|||
```
|
||||
|
||||
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -215,4 +215,6 @@ fn main() {
|
|||
println!("{}, {}, {:?}",f.name, f.data, f);
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
||||
|
|
|
@ -75,3 +75,6 @@ fn sum_multiply(nums: (i32, i32)) -> (i32, i32) {
|
|||
(nums.0 + nums.1, nums.0 * nums.1)
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -241,3 +241,5 @@ fn main() {
|
|||
assert!(count == __)
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -164,3 +164,5 @@ fn main() {
|
|||
// 你不能同时使用 r1 和 r2
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -165,3 +165,5 @@ fn main() {
|
|||
println!("{:?}, {:?}, {:?}", s1, s2, t);
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -192,4 +192,6 @@ fn main() {
|
|||
_ => ()
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -96,3 +96,5 @@ fn main() {
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
|
@ -142,3 +142,5 @@ fn main() {
|
|||
assert_eq!([x,y], __);
|
||||
}
|
||||
```
|
||||
|
||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
Loading…
Reference in New Issue