From 018443b97ef5fdb473891a88c188e3e29ad5af87 Mon Sep 17 00:00:00 2001 From: sunface Date: Sun, 28 Jan 2024 10:27:34 +0800 Subject: [PATCH] fix: practice link error --- src/advance/functional-programing/closure.md | 4 ++-- src/advance/into-types/converse.md | 6 +++--- src/advance/lifetime/static.md | 2 +- src/basic/base-type/char-bool.md | 2 +- src/basic/base-type/function.md | 2 +- src/basic/base-type/numbers.md | 2 +- src/basic/base-type/statement-expression.md | 2 +- src/basic/collections/hashmap.md | 2 +- src/basic/collections/vector.md | 2 +- src/basic/comment.md | 2 +- src/basic/compound-type/array.md | 2 +- src/basic/compound-type/enum.md | 2 +- src/basic/compound-type/string-slice.md | 6 +++--- src/basic/compound-type/struct.md | 2 +- src/basic/compound-type/tuple.md | 2 +- src/basic/crate-module/crate.md | 2 +- src/basic/crate-module/module.md | 2 +- src/basic/crate-module/use.md | 2 +- src/basic/flow-control.md | 2 +- src/basic/formatted-output.md | 2 +- src/basic/lifetime.md | 2 +- src/basic/match-pattern/all-patterns.md | 2 +- src/basic/match-pattern/match-if-let.md | 2 +- src/basic/method.md | 2 +- src/basic/ownership/borrowing.md | 2 +- src/basic/ownership/ownership.md | 2 +- src/basic/result-error/panic.md | 2 +- src/basic/result-error/result.md | 2 +- src/basic/trait/advance-trait.md | 2 +- src/basic/trait/generic.md | 4 ++-- src/basic/trait/trait-object.md | 2 +- src/basic/trait/trait.md | 2 +- src/basic/variable.md | 2 +- src/too-many-lists/do-we-need-it.md | 2 +- 34 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/advance/functional-programing/closure.md b/src/advance/functional-programing/closure.md index c8d7a20b..bc9b14bd 100644 --- a/src/advance/functional-programing/closure.md +++ b/src/advance/functional-programing/closure.md @@ -303,7 +303,7 @@ where } ``` -上面的缓存有一个很大的问题:只支持 `u32` 类型的值,若我们想要缓存 `&str` 类型,显然就行不通了,因此需要将 `u32` 替换成泛型 `E`,该练习就留给读者自己完成,具体代码可以参考[这里](https://zh-practice.course.rs/functional-programing/closure.html#closure-in-structs) +上面的缓存有一个很大的问题:只支持 `u32` 类型的值,若我们想要缓存 `&str` 类型,显然就行不通了,因此需要将 `u32` 替换成泛型 `E`,该练习就留给读者自己完成,具体代码可以参考[这里](https://practice-zh.course.rs/functional-programing/closure.html#closure-in-structs) ## 捕获作用域中的值 @@ -812,4 +812,4 @@ fn factory(x:i32) -> Box i32> { ## 课后习题 -> [Rust By Practice](https://zh-practice.course.rs/functional-programing/closure.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/functional-programing/closure.md)。 +> [Rust By Practice](https://practice-zh.course.rs/functional-programing/closure.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/functional-programing/closure.md)。 diff --git a/src/advance/into-types/converse.md b/src/advance/into-types/converse.md index c89aa5a0..1cb9f6d6 100644 --- a/src/advance/into-types/converse.md +++ b/src/advance/into-types/converse.md @@ -324,9 +324,9 @@ unsafe fn shorten_invariant_lifetime<'b, 'c>(r: &'b mut R<'static>) -> &'b mut R ## 课后练习 > Rust By Practice,支持代码在线编辑和运行,并提供详细的习题解答。 -> - [as](https://zh-practice.course.rs/type-conversions/as.html) +> - [as](https://practice-zh.course.rs/type-conversions/as.html) > - [习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/as.md) -> - [From/Into](https://zh-practice.course.rs/type-conversions/from-into.html) +> - [From/Into](https://practice-zh.course.rs/type-conversions/from-into.html) > - [习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/from-into.md) -> - [其它转换](https://zh-practice.course.rs/type-conversions/others.html) +> - [其它转换](https://practice-zh.course.rs/type-conversions/others.html) > - [习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/others.md) \ No newline at end of file diff --git a/src/advance/lifetime/static.md b/src/advance/lifetime/static.md index 762c0d23..92e8ef3b 100644 --- a/src/advance/lifetime/static.md +++ b/src/advance/lifetime/static.md @@ -186,7 +186,7 @@ fn main() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/lifetime/static.html),支持代码在线编辑和运行,并提供详细的习题解答。(本节暂无习题解答) +> [Rust By Practice](https://practice-zh.course.rs/lifetime/static.html),支持代码在线编辑和运行,并提供详细的习题解答。(本节暂无习题解答) ## 总结 diff --git a/src/basic/base-type/char-bool.md b/src/basic/base-type/char-bool.md index edac5f1a..af5ad612 100644 --- a/src/basic/base-type/char-bool.md +++ b/src/basic/base-type/char-bool.md @@ -72,5 +72,5 @@ fn main() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/basic-types/char-bool-unit.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/basic-types/char-bool.md)。 +> [Rust By Practice](https://practice-zh.course.rs/basic-types/char-bool-unit.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/basic-types/char-bool.md)。 diff --git a/src/basic/base-type/function.md b/src/basic/base-type/function.md index 4ea0dced..20ad904e 100644 --- a/src/basic/base-type/function.md +++ b/src/basic/base-type/function.md @@ -192,4 +192,4 @@ fn forever() -> ! { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/basic-types/functions.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/basic-types/functions.md)。 +> [Rust By Practice](https://practice-zh.course.rs/basic-types/functions.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/basic-types/functions.md)。 diff --git a/src/basic/base-type/numbers.md b/src/basic/base-type/numbers.md index f535682c..b9ba7175 100644 --- a/src/basic/base-type/numbers.md +++ b/src/basic/base-type/numbers.md @@ -356,7 +356,7 @@ use num::complex::Complex; ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/basic-types/numbers.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/basic-types/numbers.md)。 +> [Rust By Practice](https://practice-zh.course.rs/basic-types/numbers.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/basic-types/numbers.md)。 diff --git a/src/basic/base-type/statement-expression.md b/src/basic/base-type/statement-expression.md index 975f2044..b13e027b 100644 --- a/src/basic/base-type/statement-expression.md +++ b/src/basic/base-type/statement-expression.md @@ -113,5 +113,5 @@ fn ret_unit_type() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/basic-types/statements-expressions.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/basic-types/statements.md)。 +> [Rust By Practice](https://practice-zh.course.rs/basic-types/statements-expressions.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/basic-types/statements.md)。 diff --git a/src/basic/collections/hashmap.md b/src/basic/collections/hashmap.md index 7bc41514..026ae3d1 100644 --- a/src/basic/collections/hashmap.md +++ b/src/basic/collections/hashmap.md @@ -314,4 +314,4 @@ assert_eq!(hash.get(&42), Some(&"the answer")); ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/collections/hashmap.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/collections/Hashmap.md)。 \ No newline at end of file +> [Rust By Practice](https://practice-zh.course.rs/collections/hashmap.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/collections/Hashmap.md)。 \ No newline at end of file diff --git a/src/basic/collections/vector.md b/src/basic/collections/vector.md index 5e84e8de..7673e954 100644 --- a/src/basic/collections/vector.md +++ b/src/basic/collections/vector.md @@ -452,4 +452,4 @@ fn main() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/collections/vector.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/collections/Vector.md)。 +> [Rust By Practice](https://practice-zh.course.rs/collections/vector.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/collections/Vector.md)。 diff --git a/src/basic/comment.md b/src/basic/comment.md index fe7e2dad..b56603cf 100644 --- a/src/basic/comment.md +++ b/src/basic/comment.md @@ -472,4 +472,4 @@ Green ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/comments-docs.html),支持代码在线编辑和运行,并提供详细的习题解答。(本节暂无习题解答) \ No newline at end of file +> [Rust By Practice](https://practice-zh.course.rs/comments-docs.html),支持代码在线编辑和运行,并提供详细的习题解答。(本节暂无习题解答) \ No newline at end of file diff --git a/src/basic/compound-type/array.md b/src/basic/compound-type/array.md index a0f8cf9f..16e57fbd 100644 --- a/src/basic/compound-type/array.md +++ b/src/basic/compound-type/array.md @@ -216,4 +216,4 @@ fn main() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/compound-types/array.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/array.md)。 +> [Rust By Practice](https://practice-zh.course.rs/compound-types/array.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/array.md)。 diff --git a/src/basic/compound-type/enum.md b/src/basic/compound-type/enum.md index 0f086bef..f8b61660 100644 --- a/src/basic/compound-type/enum.md +++ b/src/basic/compound-type/enum.md @@ -292,4 +292,4 @@ let none = plus_one(None); ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/compound-types/enum.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/enum.md)。 +> [Rust By Practice](https://practice-zh.course.rs/compound-types/enum.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/enum.md)。 diff --git a/src/basic/compound-type/string-slice.md b/src/basic/compound-type/string-slice.md index f983ddc0..e7a4e563 100644 --- a/src/basic/compound-type/string-slice.md +++ b/src/basic/compound-type/string-slice.md @@ -713,11 +713,11 @@ for b in "中国人".bytes() { ## 课后练习 > Rust By Practice,支持代码在线编辑和运行,并提供详细的习题解答。 -> - [字符串](https://zh-practice.course.rs/compound-types/string.html) +> - [字符串](https://practice-zh.course.rs/compound-types/string.html) > - [习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/string.md) -> - [切片](https://zh-practice.course.rs/compound-types/slice.html) +> - [切片](https://practice-zh.course.rs/compound-types/slice.html) > - [习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/slice.md) -> - [String](https://zh-practice.course.rs/collections/String.html) +> - [String](https://practice-zh.course.rs/collections/String.html) > - [习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/collections/String.md)
diff --git a/src/basic/compound-type/struct.md b/src/basic/compound-type/struct.md index 567d1d55..15c41821 100644 --- a/src/basic/compound-type/struct.md +++ b/src/basic/compound-type/struct.md @@ -426,5 +426,5 @@ $ cargo run ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/compound-types/struct.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/struct.md)。 +> [Rust By Practice](https://practice-zh.course.rs/compound-types/struct.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/struct.md)。 diff --git a/src/basic/compound-type/tuple.md b/src/basic/compound-type/tuple.md index 9c15dacf..36de9b73 100644 --- a/src/basic/compound-type/tuple.md +++ b/src/basic/compound-type/tuple.md @@ -76,4 +76,4 @@ fn calculate_length(s: String) -> (String, usize) { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/compound-types/tuple.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/tuple.md)。 \ No newline at end of file +> [Rust By Practice](https://practice-zh.course.rs/compound-types/tuple.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/compound-types/tuple.md)。 \ No newline at end of file diff --git a/src/basic/crate-module/crate.md b/src/basic/crate-module/crate.md index e6c81a7f..bf3e19f8 100644 --- a/src/basic/crate-module/crate.md +++ b/src/basic/crate-module/crate.md @@ -111,4 +111,4 @@ error: a bin target must be available for `cargo run` ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/crate-module/crate.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/crate-module/crate.md)。 \ No newline at end of file +> [Rust By Practice](https://practice-zh.course.rs/crate-module/crate.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/crate-module/crate.md)。 \ No newline at end of file diff --git a/src/basic/crate-module/module.md b/src/basic/crate-module/module.md index 54f130d0..c9785104 100644 --- a/src/basic/crate-module/module.md +++ b/src/basic/crate-module/module.md @@ -360,4 +360,4 @@ pub mod hosting; ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/crate-module/module.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/crate-module/module.md)。 +> [Rust By Practice](https://practice-zh.course.rs/crate-module/module.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/crate-module/module.md)。 diff --git a/src/basic/crate-module/use.md b/src/basic/crate-module/use.md index b1059f25..6e146b3a 100644 --- a/src/basic/crate-module/use.md +++ b/src/basic/crate-module/use.md @@ -468,4 +468,4 @@ fn main() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/crate-module/use-pub.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/crate-module/use-pub.md)。 \ No newline at end of file +> [Rust By Practice](https://practice-zh.course.rs/crate-module/use-pub.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/crate-module/use-pub.md)。 \ No newline at end of file diff --git a/src/basic/flow-control.md b/src/basic/flow-control.md index 3022dc8d..2f2eef1b 100644 --- a/src/basic/flow-control.md +++ b/src/basic/flow-control.md @@ -370,4 +370,4 @@ fn main() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/flow-control.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/flow-control.md)。 +> [Rust By Practice](https://practice-zh.course.rs/flow-control.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/flow-control.md)。 diff --git a/src/basic/formatted-output.md b/src/basic/formatted-output.md index 91510bc6..d6982fb7 100644 --- a/src/basic/formatted-output.md +++ b/src/basic/formatted-output.md @@ -462,7 +462,7 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/formatted-output.html),支持代码在线编辑和运行,并提供详细的习题解答。(本节暂无习题解答) +> [Rust By Practice](https://practice-zh.course.rs/formatted-output.html),支持代码在线编辑和运行,并提供详细的习题解答。(本节暂无习题解答) ## 总结 diff --git a/src/basic/lifetime.md b/src/basic/lifetime.md index 70cd8642..36e33dad 100644 --- a/src/basic/lifetime.md +++ b/src/basic/lifetime.md @@ -649,7 +649,7 @@ where ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/lifetime/basic.html),支持代码在线编辑和运行,并提供详细的习题解答。(本节暂无习题解答) +> [Rust By Practice](https://practice-zh.course.rs/lifetime/basic.html),支持代码在线编辑和运行,并提供详细的习题解答。(本节暂无习题解答) ## 总结 diff --git a/src/basic/match-pattern/all-patterns.md b/src/basic/match-pattern/all-patterns.md index 17575962..2d6058f5 100644 --- a/src/basic/match-pattern/all-patterns.md +++ b/src/basic/match-pattern/all-patterns.md @@ -644,4 +644,4 @@ num @ (1 | 2) ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/pattern-match/patterns.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/pattern-match/patterns.md)。 +> [Rust By Practice](https://practice-zh.course.rs/pattern-match/patterns.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/pattern-match/patterns.md)。 diff --git a/src/basic/match-pattern/match-if-let.md b/src/basic/match-pattern/match-if-let.md index bf2ed72f..8b38ec0b 100644 --- a/src/basic/match-pattern/match-if-let.md +++ b/src/basic/match-pattern/match-if-let.md @@ -397,4 +397,4 @@ fn main() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/pattern-match/match-iflet.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/pattern-match/match.md)。 +> [Rust By Practice](https://practice-zh.course.rs/pattern-match/match-iflet.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/pattern-match/match.md)。 diff --git a/src/basic/method.md b/src/basic/method.md index 297f9bc9..e3c692e7 100644 --- a/src/basic/method.md +++ b/src/basic/method.md @@ -279,4 +279,4 @@ fn main() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/method.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/method.md)。 +> [Rust By Practice](https://practice-zh.course.rs/method.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/method.md)。 diff --git a/src/basic/ownership/borrowing.md b/src/basic/ownership/borrowing.md index 27bac657..b5a79474 100644 --- a/src/basic/ownership/borrowing.md +++ b/src/basic/ownership/borrowing.md @@ -312,4 +312,4 @@ fn no_dangle() -> String { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/ownership/borrowing.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/ownership/borrowing.md)。 +> [Rust By Practice](https://practice-zh.course.rs/ownership/borrowing.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/ownership/borrowing.md)。 diff --git a/src/basic/ownership/ownership.md b/src/basic/ownership/ownership.md index 0897a982..f9368fd2 100644 --- a/src/basic/ownership/ownership.md +++ b/src/basic/ownership/ownership.md @@ -338,5 +338,5 @@ fn takes_and_gives_back(a_string: String) -> String { // a_string 进入作用 ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/ownership/ownership.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/ownership/ownership.md)。 +> [Rust By Practice](https://practice-zh.course.rs/ownership/ownership.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/ownership/ownership.md)。 diff --git a/src/basic/result-error/panic.md b/src/basic/result-error/panic.md index 05332713..c7668381 100644 --- a/src/basic/result-error/panic.md +++ b/src/basic/result-error/panic.md @@ -214,4 +214,4 @@ let home: IpAddr = "127.0.0.1".parse().unwrap(); ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/result-panic/panic.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/result-panic/panic.md)。 +> [Rust By Practice](https://practice-zh.course.rs/result-panic/panic.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/result-panic/panic.md)。 diff --git a/src/basic/result-error/result.md b/src/basic/result-error/result.md index 044d5ab4..ced538fc 100644 --- a/src/basic/result-error/result.md +++ b/src/basic/result-error/result.md @@ -403,4 +403,4 @@ let x = try!(function_with_error()); ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/result-panic/result.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/result-panic/result.md)。 +> [Rust By Practice](https://practice-zh.course.rs/result-panic/result.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/result-panic/result.md)。 diff --git a/src/basic/trait/advance-trait.md b/src/basic/trait/advance-trait.md index 12040770..c9ef4863 100644 --- a/src/basic/trait/advance-trait.md +++ b/src/basic/trait/advance-trait.md @@ -427,4 +427,4 @@ fn main() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/generics-traits/advanced-traits.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/generics-traits/advanced-trait.md)。 +> [Rust By Practice](https://practice-zh.course.rs/generics-traits/advanced-traits.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/generics-traits/advanced-trait.md)。 diff --git a/src/basic/trait/generic.md b/src/basic/trait/generic.md index 3994a230..9b8d8121 100644 --- a/src/basic/trait/generic.md +++ b/src/basic/trait/generic.md @@ -467,7 +467,7 @@ fn main() { ## 课后练习 > Rust By Practice,支持代码在线编辑和运行,并提供详细的习题解答。 -> - [泛型](https://zh-practice.course.rs/generics-traits/generics.html) +> - [泛型](https://practice-zh.course.rs/generics-traits/generics.html) > - [习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/generics-traits/generics.md) -> - [const 泛型](https://zh-practice.course.rs/generics-traits/const-generics.html) +> - [const 泛型](https://practice-zh.course.rs/generics-traits/const-generics.html) > - [习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/generics-traits/const-generics.md) \ No newline at end of file diff --git a/src/basic/trait/trait-object.md b/src/basic/trait/trait-object.md index 9602e4a3..ddfe83ef 100644 --- a/src/basic/trait/trait-object.md +++ b/src/basic/trait/trait-object.md @@ -381,4 +381,4 @@ error[E0038]: the trait `std::clone::Clone` cannot be made into an object ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/generics-traits/trait-object.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/generics-traits/trait-object.md)。 +> [Rust By Practice](https://practice-zh.course.rs/generics-traits/trait-object.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/generics-traits/trait-object.md)。 diff --git a/src/basic/trait/trait.md b/src/basic/trait/trait.md index 6a43a4e1..687fd96d 100644 --- a/src/basic/trait/trait.md +++ b/src/basic/trait/trait.md @@ -580,4 +580,4 @@ fn main() { ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/generics-traits/traits.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/generics-traits/traits.md)。 +> [Rust By Practice](https://practice-zh.course.rs/generics-traits/traits.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/generics-traits/traits.md)。 diff --git a/src/basic/variable.md b/src/basic/variable.md index 9bbd36f9..a6e5470a 100644 --- a/src/basic/variable.md +++ b/src/basic/variable.md @@ -259,5 +259,5 @@ error: aborting due to previous error ## 课后练习 -> [Rust By Practice](https://zh-practice.course.rs/variables.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/variables.md)。 +> [Rust By Practice](https://practice-zh.course.rs/variables.html),支持代码在线编辑和运行,并提供详细的[习题解答](https://github.com/sunface/rust-by-practice/blob/master/solutions/variables.md)。 diff --git a/src/too-many-lists/do-we-need-it.md b/src/too-many-lists/do-we-need-it.md index 8e464ef3..700ddfea 100644 --- a/src/too-many-lists/do-we-need-it.md +++ b/src/too-many-lists/do-we-need-it.md @@ -49,7 +49,7 @@ $ cd lists #### 我无法接受内存重新分配的代价 -是的,`Vec` 当 [`capacity`](https://zh-practice.course.rs/collections/vector.html#capacity) 不够时,会重新分配一块内存,然后将之前的 `Vec` 全部拷贝过去,但是对于绝大多数使用场景,要么 `Vec` 不在热点路径中,要么 `Vec` 的容量可以提前预测。 +是的,`Vec` 当 [`capacity`](https://practice-zh.course.rs/collections/vector.html#capacity) 不够时,会重新分配一块内存,然后将之前的 `Vec` 全部拷贝过去,但是对于绝大多数使用场景,要么 `Vec` 不在热点路径中,要么 `Vec` 的容量可以提前预测。 对于前者,那性能如何自然无关紧要。而对于后者,我们只需要使用 `Vec::with_capacity` 提前分配足够的空间即可,同时,Rust 中所有的迭代器还提供了 `size_hint` 也可以解决这种问题。