diff --git a/src/title-page.md b/src/title-page.md index 2bced8d..7207479 100644 --- a/src/title-page.md +++ b/src/title-page.md @@ -12,18 +12,16 @@ > 6. 本站支持文档中英文切换,点击页面右上角语言图标可切换到相同章节的英文页面,**英文版每天都会自动同步一次官方的最新版本**。 > 7. 若发现本页表达错误或帮助我们改进翻译,可点击右上角的编辑按钮打开本页对应源码文件进行编辑和修改,Rust 中文资源的开源组织发展离不开大家,感谢您的支持和帮助! -[rust-1.57.0]: https://doc.rust-lang.org/1.57.0/book/ -[rust-nightly]: https://doc.rust-lang.org/nightly/book/ -[book-website]: https://doc.rust-lang.org/book -[book-cn]: https://github.com/rust-lang-cn/book-cn -[trpl-translation]: https://rustwiki.org/wiki/translate/other-translation/#the-rust-programing-language - 本书的版本假设你使用 Rust 1.57(2021 年 12 月 2 日发布) 或更高版本。请参阅第 1 章的[“安装”][install]部分来安装或更新 Rust。 HTML 格式可在 [https://rustwiki.org/zh-CN/book/](https://rustwiki.org/zh-CN/book/) 网站上阅读(英文版为:[https://doc.rust-lang.org/stable/book/](https://doc.rust-lang.org/stable/book/)), 而离线阅读可在安装 Rust 后使用 `rustup` 生成(注:目前此命令只生成英文版,需要中文离线版可从[本书的中文翻译 GitHub 仓库][book-cn]上获取) ;运行 `rustup docs --book` 来打开本书。 可以从 [No Starch Press 获得平装图书和电子书格式][nsprust](注:中文出版书名为《Rust 权威指南》,可从购书平台中购买)。 -[install]: ch01-01-installation.html +[rust-1.57.0]: https://doc.rust-lang.org/1.57.0/book/ +[rust-nightly]: https://doc.rust-lang.org/nightly/book/ +[book-website]: https://doc.rust-lang.org/book [book-cn]: https://github.com/rust-lang-cn/book-cn +[trpl-translation]: https://rustwiki.org/wiki/translate/other-translation/#the-rust-programing-language +[install]: ch01-01-installation.html [nsprust]: https://nostarch.com/rust diff --git a/tools/src/bin/convert_quotes.rs b/tools/src/bin/convert_quotes.rs index e548c5e..c8cfd45 100644 --- a/tools/src/bin/convert_quotes.rs +++ b/tools/src/bin/convert_quotes.rs @@ -8,7 +8,7 @@ fn main() { let mut buffer = String::new(); if let Err(e) = io::stdin().read_to_string(&mut buffer) { - panic!(e); + panic!("{}", e); } for line in buffer.lines() { diff --git a/tools/src/bin/link2print.rs b/tools/src/bin/link2print.rs index 33d90ec..d183c0a 100644 --- a/tools/src/bin/link2print.rs +++ b/tools/src/bin/link2print.rs @@ -14,7 +14,7 @@ fn read_md() -> String { let mut buffer = String::new(); match io::stdin().read_to_string(&mut buffer) { Ok(_) => buffer, - Err(error) => panic!(error), + Err(error) => panic!("{}", error), } } diff --git a/tools/src/bin/remove_hidden_lines.rs b/tools/src/bin/remove_hidden_lines.rs index fa3b705..45ce031 100644 --- a/tools/src/bin/remove_hidden_lines.rs +++ b/tools/src/bin/remove_hidden_lines.rs @@ -9,7 +9,7 @@ fn read_md() -> String { let mut buffer = String::new(); match io::stdin().read_to_string(&mut buffer) { Ok(_) => buffer, - Err(error) => panic!(error), + Err(error) => panic!("{}", error), } } diff --git a/tools/src/bin/remove_links.rs b/tools/src/bin/remove_links.rs index a096389..edccc53 100644 --- a/tools/src/bin/remove_links.rs +++ b/tools/src/bin/remove_links.rs @@ -8,7 +8,7 @@ use std::io::{Read, Write}; fn main() { let mut buffer = String::new(); if let Err(e) = io::stdin().read_to_string(&mut buffer) { - panic!(e); + panic!("{}", e); } let mut refs = HashSet::new(); diff --git a/tools/src/bin/remove_markup.rs b/tools/src/bin/remove_markup.rs index 8877e03..06f6a6b 100644 --- a/tools/src/bin/remove_markup.rs +++ b/tools/src/bin/remove_markup.rs @@ -12,7 +12,7 @@ fn read_md() -> String { let mut buffer = String::new(); match io::stdin().read_to_string(&mut buffer) { Ok(_) => buffer, - Err(error) => panic!(error), + Err(error) => panic!("{}", error), } } @@ -39,9 +39,11 @@ fn remove_markup(input: String) -> String { } else { let result = regexen.iter().fold(line.to_string(), |result, regex| { - regex.replace_all(&result, |caps: &Captures<'_>| { - caps.get(1).unwrap().as_str().to_string() - }).to_string() + regex + .replace_all(&result, |caps: &Captures<'_>| { + caps.get(1).unwrap().as_str().to_string() + }) + .to_string() }); Some(result) }