Go to file
Live4dreamCH bf15d06e34
PR:修改7.4中pub use部分的表述
您好!我是rust的初学者,在阅读pub use部分时没有太理解,于是去读了这部分的英文原文,并尝试着修改,使这段更简单易懂。
这是我第一次PR,如有不妥请您多多谅解!
以下是我的验证代码,可以通过编译。
```rust
// 我们所导入的mod
mod front_of_house {
    pub mod hosting {
        pub fn add_to_waitlist() {}
    }
}

// 我们的mod
mod curr {
    pub use crate::front_of_house::hosting; // 重导出
    pub fn eat_at_restaurant() {
        hosting::add_to_waitlist();
    }
}

// 导入我们代码的mod
mod others {
    use crate::curr;
    pub fn others_fn() {
        curr::hosting::add_to_waitlist(); // 使用重导出
        curr::eat_at_restaurant();
    }
}

fn main() {
    others::others_fn();
    println!("Hello, world!");
}
```
2022-02-17 20:08:30 +08:00
.github/workflows Update main.yml 2022-02-06 16:46:31 +08:00
listings update to appendix-07 2022-02-10 23:01:01 +08:00
src PR:修改7.4中pub use部分的表述 2022-02-17 20:08:30 +08:00
theme update to ch03-05 2022-02-06 22:46:20 +08:00
.editorconfig fix mdbook-latex related format 2020-07-05 17:55:59 +08:00
.gitattributes Create .gitattributes 2019-01-15 10:29:21 +08:00
.gitignore update to the latest document(2021-12-05) 2021-12-05 02:02:24 +08:00
book.json check to ch19-02 2018-03-05 09:59:52 +08:00
book.toml update to ch03-05 2022-02-06 22:46:20 +08:00
custom-template.tex fix mdbook-latex related format 2020-07-05 17:55:59 +08:00
ferris.css update to ch03-05 2022-02-06 22:46:20 +08:00
ferris.js update to ch03-05 2022-02-06 22:46:20 +08:00
LICENSE Update LICENSE 2018-08-29 09:15:03 +08:00
README.md update to ch14-05 2022-02-09 19:16:45 +08:00
vuepress_page.png Vuepress构建静态页面效果截图 2018-07-19 10:45:02 +08:00

Rust 程序设计语言2021 edition 施工中) 简体中文版

Build Status

状态

2021 edition 施工中。

PS:

静态页面构建与文档撰写

image

构建

你可以将本 mdbook 构建成一系列静态 html 页面。这里我们采用 vuepress 打包出静态网页。在这之前,你需要安装 Nodejs

全局安装 vuepress

npm i -g vuepress

cd 到项目目录,然后开始构建。构建好的静态文档会出现在 "./src/.vuepress/dist" 中

vuepress build ./src

文档撰写

vuepress 会启动一个本地服务器,并在浏览器对你保存的文档进行实时热更新。

vuepress dev ./src

社区资源

GitBook

本翻译主要采用 mdBook 格式。同时支持 GitBook,但会缺失部分功能,如一些代码没有语法高亮。

本翻译加速查看站点有:

GitBook.com 地址:https://kaisery.github.io/trpl-zh-cn/