trpl-zh-cn/src
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
..
.vuepress add vuepress config, close #427 2020-06-30 16:29:15 +08:00
img docs: update ch00 and ch01 sections 2021-08-08 17:45:24 +08:00
appendix-00.md 更新原文链接 2021-06-03 11:47:23 +08:00
appendix-01-keywords.md update to appendix-07 2022-02-10 23:01:01 +08:00
appendix-02-operators.md update to appendix-07 2022-02-10 23:01:01 +08:00
appendix-03-derivable-traits.md update to appendix-07 2022-02-10 23:01:01 +08:00
appendix-04-useful-development-tools.md update to appendix-07 2022-02-10 23:01:01 +08:00
appendix-05-editions.md update to appendix-07 2022-02-10 23:01:01 +08:00
appendix-06-translation.md update to appendix-07 2022-02-10 23:01:01 +08:00
appendix-07-nightly-rust.md update to appendix-07 2022-02-10 23:01:01 +08:00
ch00-00-introduction.md add listings code && update to ch02-00 2022-02-06 16:43:51 +08:00
ch01-00-getting-started.md 更新原文链接 2021-06-03 12:26:20 +08:00
ch01-01-installation.md Merge branch 'master' into main 2022-02-06 16:59:06 +08:00
ch01-02-hello-world.md fix minted 2022-02-14 23:46:54 +08:00
ch01-03-hello-cargo.md Merge branch 'master' into main 2022-02-06 16:59:06 +08:00
ch02-00-guessing-game-tutorial.md fix ch02-00 2022-02-14 18:15:42 +08:00
ch03-00-common-programming-concepts.md update to ch03-05 2022-02-06 22:46:20 +08:00
ch03-01-variables-and-mutability.md update to ch03-05 2022-02-06 22:46:20 +08:00
ch03-02-data-types.md update to ch03-05 2022-02-06 22:46:20 +08:00
ch03-03-how-functions-work.md update to ch03-05 2022-02-06 22:46:20 +08:00
ch03-04-comments.md update to ch03-05 2022-02-06 22:46:20 +08:00
ch03-05-control-flow.md update to ch03-05 2022-02-06 22:46:20 +08:00
ch04-00-understanding-ownership.md update to ch04-02 2022-02-06 23:46:50 +08:00
ch04-01-what-is-ownership.md update to ch04-02 2022-02-06 23:46:50 +08:00
ch04-02-references-and-borrowing.md update to ch04-02 2022-02-06 23:46:50 +08:00
ch04-03-slices.md update to ch05-03 2022-02-07 11:37:16 +08:00
ch05-00-structs.md update to ch05-03 2022-02-07 11:37:16 +08:00
ch05-01-defining-structs.md update to ch05-03 2022-02-07 11:37:16 +08:00
ch05-02-example-structs.md update to ch05-03 2022-02-07 11:37:16 +08:00
ch05-03-method-syntax.md update to ch05-03 2022-02-07 11:37:16 +08:00
ch06-00-enums.md update to ch06-03 2022-02-07 14:36:29 +08:00
ch06-01-defining-an-enum.md update to ch06-03 2022-02-07 14:36:29 +08:00
ch06-02-match.md update to ch06-03 2022-02-07 14:36:29 +08:00
ch06-03-if-let.md update to ch06-03 2022-02-07 14:36:29 +08:00
ch07-00-managing-growing-projects-with-packages-crates-and-modules.md update to ch07-05 2022-02-07 15:06:23 +08:00
ch07-01-packages-and-crates.md update to ch07-05 2022-02-07 15:06:23 +08:00
ch07-02-defining-modules-to-control-scope-and-privacy.md update to ch07-05 2022-02-07 15:06:23 +08:00
ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md update to ch07-05 2022-02-07 15:06:23 +08:00
ch07-04-bringing-paths-into-scope-with-the-use-keyword.md PR:修改7.4中pub use部分的表述 2022-02-17 20:08:30 +08:00
ch07-05-separating-modules-into-different-files.md update to ch07-05 2022-02-07 15:06:23 +08:00
ch08-00-common-collections.md update to ch08-03 2022-02-07 16:14:15 +08:00
ch08-01-vectors.md update to ch08-03 2022-02-07 16:14:15 +08:00
ch08-02-strings.md update to ch08-03 2022-02-07 16:14:15 +08:00
ch08-03-hash-maps.md update to ch08-03 2022-02-07 16:14:15 +08:00
ch09-00-error-handling.md update to ch09-03 2022-02-07 21:47:49 +08:00
ch09-01-unrecoverable-errors-with-panic.md update to ch09-03 2022-02-07 21:47:49 +08:00
ch09-02-recoverable-errors-with-result.md update to ch09-03 2022-02-07 21:47:49 +08:00
ch09-03-to-panic-or-not-to-panic.md update to ch09-03 2022-02-07 21:47:49 +08:00
ch10-00-generics.md update to ch10-03 2022-02-08 10:27:36 +08:00
ch10-01-syntax.md update to ch10-03 2022-02-08 10:27:36 +08:00
ch10-02-traits.md update to ch10-03 2022-02-08 10:27:36 +08:00
ch10-03-lifetime-syntax.md update to ch10-03 2022-02-08 10:27:36 +08:00
ch11-00-testing.md 更新原文链接 2021-06-03 12:26:20 +08:00
ch11-01-writing-tests.md update to ch11-03 2022-02-09 10:16:09 +08:00
ch11-02-running-tests.md update to ch11-03 2022-02-09 10:16:09 +08:00
ch11-03-test-organization.md update to ch11-03 2022-02-09 10:16:09 +08:00
ch12-00-an-io-project.md 更新原文链接 2021-06-03 12:26:20 +08:00
ch12-01-accepting-command-line-arguments.md update to ch12-06 2022-02-09 16:54:09 +08:00
ch12-02-reading-a-file.md update to ch12-06 2022-02-09 16:54:09 +08:00
ch12-03-improving-error-handling-and-modularity.md update to ch12-06 2022-02-09 16:54:09 +08:00
ch12-04-testing-the-librarys-functionality.md update to ch12-06 2022-02-09 16:54:09 +08:00
ch12-05-working-with-environment-variables.md update to ch12-06 2022-02-09 16:54:09 +08:00
ch12-06-writing-to-stderr-instead-of-stdout.md update to ch12-06 2022-02-09 16:54:09 +08:00
ch13-00-functional-features.md 更新原文链接 2021-06-03 12:26:20 +08:00
ch13-01-closures.md update to ch13-04 2022-02-09 18:59:22 +08:00
ch13-02-iterators.md update to ch13-04 2022-02-09 18:59:22 +08:00
ch13-03-improving-our-io-project.md update to ch13-04 2022-02-09 18:59:22 +08:00
ch13-04-performance.md update to ch13-04 2022-02-09 18:59:22 +08:00
ch14-00-more-about-cargo.md 更新原文链接 2021-06-03 12:26:20 +08:00
ch14-01-release-profiles.md update to ch14-05 2022-02-09 19:16:45 +08:00
ch14-02-publishing-to-crates-io.md update to ch14-05 2022-02-09 19:16:45 +08:00
ch14-03-cargo-workspaces.md update to ch14-05 2022-02-09 19:16:45 +08:00
ch14-04-installing-binaries.md update to ch14-05 2022-02-09 19:16:45 +08:00
ch14-05-extending-cargo.md 更新原文链接 2021-06-03 12:26:20 +08:00
ch15-00-smart-pointers.md 更新原文链接 2021-06-03 12:26:20 +08:00
ch15-01-box.md update to ch15-06 2022-02-10 11:28:06 +08:00
ch15-02-deref.md update to ch15-06 2022-02-10 11:28:06 +08:00
ch15-03-drop.md update to ch15-06 2022-02-10 11:28:06 +08:00
ch15-04-rc.md update to ch15-06 2022-02-10 11:28:06 +08:00
ch15-05-interior-mutability.md update to ch15-06 2022-02-10 11:28:06 +08:00
ch15-06-reference-cycles.md update to ch15-06 2022-02-10 11:28:06 +08:00
ch16-00-concurrency.md update to ch16-04 2022-02-10 13:28:50 +08:00
ch16-01-threads.md update to ch16-04 2022-02-10 13:28:50 +08:00
ch16-02-message-passing.md update to ch16-04 2022-02-10 13:28:50 +08:00
ch16-03-shared-state.md update to ch16-04 2022-02-10 13:28:50 +08:00
ch16-04-extensible-concurrency-sync-and-send.md update to ch16-04 2022-02-10 13:28:50 +08:00
ch17-00-oop.md 更新原文链接 2021-06-03 12:26:20 +08:00
ch17-01-what-is-oo.md update to ch17-03 2022-02-10 14:30:38 +08:00
ch17-02-trait-objects.md update to ch17-03 2022-02-10 14:30:38 +08:00
ch17-03-oo-design-patterns.md update to ch17-03 2022-02-10 14:30:38 +08:00
ch18-00-patterns.md update to ch18-03 2022-02-10 15:15:40 +08:00
ch18-01-all-the-places-for-patterns.md update to ch18-03 2022-02-10 15:15:40 +08:00
ch18-02-refutability.md update to ch18-03 2022-02-10 15:15:40 +08:00
ch18-03-pattern-syntax.md update to ch18-03 2022-02-10 15:15:40 +08:00
ch19-00-advanced-features.md 更新原文链接 2021-06-03 12:26:20 +08:00
ch19-01-unsafe-rust.md update to ch19-06 2022-02-10 16:52:17 +08:00
ch19-03-advanced-traits.md update to ch19-06 2022-02-10 16:52:17 +08:00
ch19-04-advanced-types.md update to ch19-06 2022-02-10 16:52:17 +08:00
ch19-05-advanced-functions-and-closures.md update to ch19-06 2022-02-10 16:52:17 +08:00
ch19-06-macros.md update to ch19-06 2022-02-10 16:52:17 +08:00
ch20-00-final-project-a-web-server.md 更新原文链接 2021-06-03 12:26:20 +08:00
ch20-01-single-threaded.md update to appendix-07 2022-02-10 23:01:01 +08:00
ch20-02-multithreaded.md update to appendix-07 2022-02-10 23:01:01 +08:00
ch20-03-graceful-shutdown-and-cleanup.md update to appendix-07 2022-02-10 23:01:01 +08:00
foreword.md Update foreword.md 2021-07-23 00:43:18 +08:00
PREFACE.md check to apendix-03 2018-12-09 23:22:10 +08:00
README.md update to the latest document(2021-12-05) 2021-12-05 02:02:24 +08:00
SUMMARY.md update to the latest document(2021-12-05) 2021-12-05 02:02:24 +08:00
title-page.md Merge branch 'master' into main 2022-02-06 16:59:06 +08:00

Rust 程序设计语言

Rust 程序设计语言 前言 介绍

入门指南

基本 Rust 技能

Rust 编程思想

高级主题