From a9d2e2e19ef560c604f8b6e6016b84c47157e2b9 Mon Sep 17 00:00:00 2001 From: inyourface34456 <62214409+inyourface34456@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:22:43 -0500 Subject: [PATCH 1/4] Fixed a link and linked one to the book rather then the repo --- en/src/elegant-code-base.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/src/elegant-code-base.md b/en/src/elegant-code-base.md index 3384ff7..b85343e 100644 --- a/en/src/elegant-code-base.md +++ b/en/src/elegant-code-base.md @@ -24,7 +24,7 @@ Tutorial [`https://www.flenker.blog/hecto/`](https://www.flenker.blog/hecto/) wi [This project](https://github.com/kyclark/command-line-rust) is for the book `Command-Line Rust(O'Reily)`, it will show you how to write small CLIs (clones of `head`, `cat`, `ls`). ### 5. pngme book -[This book](https://picklenerd.github.io/pngme_book/) will guide you to make a command line program that lets you hide secret messages in PNG files. The primary goal here is to get you writing code. The secondary goal is to get you reading documentation. +[This book](https://jrdngr.github.io/pngme_book/) will guide you to make a command line program that lets you hide secret messages in PNG files. The primary goal here is to get you writing code. The secondary goal is to get you reading documentation. ### 6. Writing an OS in Rust @@ -40,7 +40,7 @@ On [CodeCrafters](https://codecrafters.io/for/rust), you can recreate your favor ### 9. Writing Interpreters in Rust -[This online book](https://github.com/rust-hosted-langs/book) will walk through the basics of interpreted language implementation in Rust with a focus on the challenges that are specific to using Rust. +[This online book](https://rust-hosted-langs.github.io/book/) will walk through the basics of interpreted language implementation in Rust with a focus on the challenges that are specific to using Rust. --- From a6769fa06319c7922979656c433272474b4e6953 Mon Sep 17 00:00:00 2001 From: inyourface34456 <62214409+inyourface34456@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:28:07 -0500 Subject: [PATCH 2/4] changed one link to the book --- zh-CN/src/elegant-code-base.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh-CN/src/elegant-code-base.md b/zh-CN/src/elegant-code-base.md index d5438b7..c643e19 100644 --- a/zh-CN/src/elegant-code-base.md +++ b/zh-CN/src/elegant-code-base.md @@ -44,9 +44,9 @@ ### 9. 使用 Rust 写一个解析器 -[这本开源书](https://github.com/rust-hosted-langs/book) 是一个使用 Rust 语言实现编译型语言的教程。 +[这本开源书](https://rust-hosted-langs.github.io/book/) 是一个使用 Rust 语言实现编译型语言的教程。 ### 10. Rust编写推箱子游戏教程 [sokoban](https://sokoban.iolivia.me/zh_cn/c01-00-intro) 是一个使用 Rust 语言实现 sokoban 游戏的教程。虽然社区已停止活跃( Initial Commits on Sep 3, 2019,GitHub 仓库最后一条 commit 是 last year ),但是项目是完善的 release v0.1.0,拿来练手是个不错的选择。 -**To be continued...** \ No newline at end of file +**To be continued...** From 253042417ad4542cd54de819c14368f38f672a45 Mon Sep 17 00:00:00 2001 From: sunfei Date: Wed, 24 Jan 2024 16:46:52 +0800 Subject: [PATCH 3/4] chore: rename practice.rs to practice.course.rs --- en/assets/CNAME | 2 +- en/assets/lang.js | 26 ------------------------ en/assets/lang1.js | 35 ++++++++++++++++++++++++++++++++ en/book.toml | 4 ++-- zh-CN/assets/CNAME | 2 +- zh-CN/assets/lang.js | 26 ------------------------ zh-CN/assets/lang1.js | 35 ++++++++++++++++++++++++++++++++ zh-CN/book.toml | 4 ++-- zh-CN/src/collections/hashmap.md | 2 +- 9 files changed, 77 insertions(+), 59 deletions(-) delete mode 100644 en/assets/lang.js create mode 100644 en/assets/lang1.js delete mode 100644 zh-CN/assets/lang.js create mode 100644 zh-CN/assets/lang1.js diff --git a/en/assets/CNAME b/en/assets/CNAME index c6cd02a..085168d 100644 --- a/en/assets/CNAME +++ b/en/assets/CNAME @@ -1 +1 @@ -practice.rs \ No newline at end of file +practice.course.rs \ No newline at end of file diff --git a/en/assets/lang.js b/en/assets/lang.js deleted file mode 100644 index 061d375..0000000 --- a/en/assets/lang.js +++ /dev/null @@ -1,26 +0,0 @@ -(function () { - var path = window.location.pathname; - var link = "https://practice.rs" + path; - var word = "English"; - var lang = "zh-CN"; - var changeLang = "切换到英语"; - - if (window.location.href.indexOf("zh.") == -1) { - link = "https://zh.practice.rs" + path; - word = "简体中文"; - lang = "en"; - changeLang = "Switch to Chinese" - } - - var lang_node = ''; - if (link != '') { - lang_node = ' ' + word + ''; - } - - console.log(lang_node) - var insertNode = document.getElementsByClassName('right-buttons'); - if (insertNode.length > 0) { - var html = insertNode[0].innerHTML; - insertNode[0].innerHTML = html + lang_node; - } - })() \ No newline at end of file diff --git a/en/assets/lang1.js b/en/assets/lang1.js new file mode 100644 index 0000000..adf2b00 --- /dev/null +++ b/en/assets/lang1.js @@ -0,0 +1,35 @@ +(function () { + var path = window.location.pathname; + var link = "https://practice.course.rs" + path; + var word = "English"; + var lang = "zh-CN"; + var changeLang = "切换到英语"; + + if (window.location.href.indexOf("zh.") == -1) { + link = "https://practice-zh.course.rs" + path; + word = "简体中文"; + lang = "en"; + changeLang = "Switch to Chinese"; + } + + var lang_node = ""; + if (link != "") { + lang_node = + ' ' + + word + + ""; + } + + console.log(lang_node); + var insertNode = document.getElementsByClassName("right-buttons"); + if (insertNode.length > 0) { + var html = insertNode[0].innerHTML; + insertNode[0].innerHTML = html + lang_node; + } +})(); diff --git a/en/book.toml b/en/book.toml index eae6c2c..abe5695 100644 --- a/en/book.toml +++ b/en/book.toml @@ -14,9 +14,9 @@ level = 1 [output.html] additional-css = ["theme/style1.css"] -additional-js = ["assets/custom3.js","assets/lang.js"] +additional-js = ["assets/custom3.js", "assets/lang1.js"] git-repository-url = "https://github.com/sunface/rust-by-practice" edit-url-template = "https://github.com/sunface/rust-by-practice/edit/master/en/{path}" [rust] -edition = "2021" \ No newline at end of file +edition = "2021" diff --git a/zh-CN/assets/CNAME b/zh-CN/assets/CNAME index ffc44bc..89e2aa2 100644 --- a/zh-CN/assets/CNAME +++ b/zh-CN/assets/CNAME @@ -1 +1 @@ -zh.practice.rs \ No newline at end of file +practice-zh.course.rs \ No newline at end of file diff --git a/zh-CN/assets/lang.js b/zh-CN/assets/lang.js deleted file mode 100644 index 061d375..0000000 --- a/zh-CN/assets/lang.js +++ /dev/null @@ -1,26 +0,0 @@ -(function () { - var path = window.location.pathname; - var link = "https://practice.rs" + path; - var word = "English"; - var lang = "zh-CN"; - var changeLang = "切换到英语"; - - if (window.location.href.indexOf("zh.") == -1) { - link = "https://zh.practice.rs" + path; - word = "简体中文"; - lang = "en"; - changeLang = "Switch to Chinese" - } - - var lang_node = ''; - if (link != '') { - lang_node = ' ' + word + ''; - } - - console.log(lang_node) - var insertNode = document.getElementsByClassName('right-buttons'); - if (insertNode.length > 0) { - var html = insertNode[0].innerHTML; - insertNode[0].innerHTML = html + lang_node; - } - })() \ No newline at end of file diff --git a/zh-CN/assets/lang1.js b/zh-CN/assets/lang1.js new file mode 100644 index 0000000..1f6e8a3 --- /dev/null +++ b/zh-CN/assets/lang1.js @@ -0,0 +1,35 @@ +(function () { + var path = window.location.pathname; + var link = "https://practice.course.rs" + path; + var word = "English"; + var lang = "zh-CN"; + var changeLang = "切换到英语"; + + if (window.location.href.indexOf("zh.") == -1) { + link = "https://practice-zh.practice.rs" + path; + word = "简体中文"; + lang = "en"; + changeLang = "Switch to Chinese"; + } + + var lang_node = ""; + if (link != "") { + lang_node = + ' ' + + word + + ""; + } + + console.log(lang_node); + var insertNode = document.getElementsByClassName("right-buttons"); + if (insertNode.length > 0) { + var html = insertNode[0].innerHTML; + insertNode[0].innerHTML = html + lang_node; + } +})(); diff --git a/zh-CN/book.toml b/zh-CN/book.toml index 9e3feb1..6ec0e15 100644 --- a/zh-CN/book.toml +++ b/zh-CN/book.toml @@ -14,9 +14,9 @@ level = 1 [output.html] additional-css = ["theme/style1.css"] -additional-js = ["assets/custom3.js","assets/lang.js"] +additional-js = ["assets/custom3.js", "assets/lang1.js"] git-repository-url = "https://github.com/sunface/rust-by-practice" edit-url-template = "https://github.com/sunface/rust-by-practice/edit/master/zh-CN/{path}" [rust] -edition = "2021" \ No newline at end of file +edition = "2021" diff --git a/zh-CN/src/collections/hashmap.md b/zh-CN/src/collections/hashmap.md index 296103c..a8523e7 100644 --- a/zh-CN/src/collections/hashmap.md +++ b/zh-CN/src/collections/hashmap.md @@ -149,7 +149,7 @@ fn main() { ### 容量 -关于容量,我们在之前的 [Vector](https://zh.practice.rs/collections/vector.html#容量) 中有详细的介绍,而 `HashMap` 也可以调整容量: 你可以通过 `HashMap::with_capacity(uint)` 使用指定的容量来初始化,或者使用 `HashMap::new()` ,后者会提供一个默认的初始化容量。 +关于容量,我们在之前的 [Vector](https://practice-zh.course.rs/collections/vector.html#容量) 中有详细的介绍,而 `HashMap` 也可以调整容量: 你可以通过 `HashMap::with_capacity(uint)` 使用指定的容量来初始化,或者使用 `HashMap::new()` ,后者会提供一个默认的初始化容量。 #### 示例 From 9444c42b884ee873aea77cc990b5c4fad23079c0 Mon Sep 17 00:00:00 2001 From: h3n4l Date: Sun, 4 Feb 2024 02:18:01 +0800 Subject: [PATCH 4/4] chore: remove all .DS_Store file Signed-off-by: h3n4l --- .gitignore | 2 +- zh-CN/.DS_Store | Bin 10244 -> 0 bytes zh-CN/src/.DS_Store | Bin 6148 -> 0 bytes 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 zh-CN/.DS_Store delete mode 100644 zh-CN/src/.DS_Store diff --git a/.gitignore b/.gitignore index f2f22ba..653c8d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ en/book zh-CN/book -.DS_Store +**/.DS_Store diff --git a/zh-CN/.DS_Store b/zh-CN/.DS_Store deleted file mode 100644 index ff91dd359b50702cadb2ee38ab62ce6fee598397..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10244 zcmeHMOK=oL818Qpk{L3P0TKzAk*x$uzyv}PNO)CkUdlVjCgj0m+1(k*z+@)u%qGDQ zD`k}z5G_wyzDiEMN)9SYdGVkqdQ`Lu%kqGwrCziOFDeKB>7FI9!IN4lPH#>B^LPJ$ z_xxXf|4el+V+`#%V+~_5#+Xc3AT^b$Ta=(bxMmb7Y$+iL@@LFvUV6+MN!xCEhIP~s zArK)DArK)DArK+(Z$N;)*+G%ZgpBG4fe3*Jf$Ina?}r#&fsBW8N=W|dpo(t+NETBw zFLY1)0PYhDWjvHqLULCcQ|ulPx+2_SK)6$XEHEb-59O4Q!kt05GlVlE+@XNaPJS_N z&JY(esv`s<1ZE--?A=RPih1-i3-<5l(<8R!`3()9LntYk@8yo6k%}whjCl$G}cJ;IZW+=PZ7nMWtkgJD*lm38=Kcsq%G_IWTasP4TX+JMX_#uFadjK&?~d`YQ2aOyHF-{qZz#;zJ&9|(qPGYlTX;;KdEdP47&wNK=v zrdiIYMd?k;DzaRzjUOA~t5X|aDORaAzgQgT+IWM|75a$ltdVuH9qbUL*aSPxo?>U% zo9qJnfPKckV&Ai?>=ytfD8+1)p#qDs6m?jO7PMkL+R=^O*nV*)4e z2u|V@PUA5=iRbV!hJWX#TKWF?+dBPdb8BxI2OFReFyO!jW zZaNJ`TJ}<^nB#Jgv07hcw&Zr4hLT3x?NrnJ-~uBz3IO$sHSRuroB zEu=yy>c&k9rJ+_Fs&~anWn8JQ?(CvrE^6{$#qrDR3j2=z#I6y?=VAe>a5ox=+3nbZ zU7Xtq^x`0rID|9|48wtoW5n_kn8ZVv!o$SzM~UT+;|V;CXYedB{YAWlm+>lIBc8vF z^LPjE;eA}dhauy?B)Wfvhiy|ra(A-f?j*%&{@?y*K(zl4;1>l-wEzDf?*D%W$Ijy} diff --git a/zh-CN/src/.DS_Store b/zh-CN/src/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0