Skip to content

Commit

Permalink
Merge pull request #67 from yuqiang-yuan/item32-ci
Browse files Browse the repository at this point in the history
item 32 done; alter links to translated files
  • Loading branch information
lispking authored Sep 19, 2024
2 parents 0eff1a2 + c97c585 commit 6c1b335
Show file tree
Hide file tree
Showing 13 changed files with 175 additions and 82 deletions.
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- [第 29 条:遵循 Clippy 的建议](./chapter_5/item29-listen-to-clippy.md)
- [第 30 条:不仅仅是单测](./chapter_5/item30-write-more-than-unit-tests.md)
- [第 31 条:使用生态系统工具](./chapter_5/item31-use-tools.md)
- [第 32 条:搭建持续集成(CI)系统](./chapter_5/item32-ci.md)
- [超出 Rust 标准](./chapter_6.md)
- [第 33 条:考虑使库代码与 `no_std` 兼容](./chapter_6/item33-no-std.md)
- [第 35 条:优先使用bindgen而不是手动FFI映射](./chapter_6/item35-bindgen.md)
Expand Down
6 changes: 3 additions & 3 deletions src/chapter_3/item17-deadlock.md
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,9 @@ Go 语言[内置了](https://go.dev/ref/spec#Channel_types)用于这种操作的
[第 15 条]: https://www.lurklurk.org/effective-rust/borrows.html
[第 16 条]: https://www.lurklurk.org/effective-rust/unsafe.html
[第 34 条]: https://www.lurklurk.org/effective-rust/ffi.html
[第 18 条]: https://www.lurklurk.org/effective-rust/panic.html
[第 30 条]: https://www.lurklurk.org/effective-rust/testing.html
[第 32 条]: https://www.lurklurk.org/effective-rust/ci.html
[第 18 条]: ./item18-panic.md
[第 30 条]: ../chapter_5/item30-write-more-than-unit-tests.md
[第 32 条]: ../chapter_5/item32-ci.md
[“无畏并发”]: https://doc.rust-lang.org/book/ch16-00-concurrency.html
[`std::lock_guard`]: https://en.cppreference.com/w/cpp/thread/lock_guard
[Rust “免费” 获得了线程安全]: https://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html
Expand Down
6 changes: 3 additions & 3 deletions src/chapter_3/item18-panic.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
<!-- 参考链接 -->

[第 4 条]: https://www.lurklurk.org/effective-rust/errors.html
[第 27 条]: https://www.lurklurk.org/effective-rust/documentation.html
[第 31 条]: https://www.lurklurk.org/effective-rust/use-tools.html
[第 32 条]: https://www.lurklurk.org/effective-rust/ci.html
[第 27 条]: ../chapter_5/item27-document-public-interfaces.md
[第 31 条]: ../chapter_5/item31-use-tools.md
[第 32 条]: ../chapter_5/item32-ci.md
[第 34 条]: https://www.lurklurk.org/effective-rust/ffi.html
[`std::panic::catch_unwind`]: https://doc.rust-lang.org/std/panic/fn.catch_unwind.html
[编译器选项]: https://doc.rust-lang.org/rustc/codegen-options/index.html#panic
Expand Down
2 changes: 1 addition & 1 deletion src/chapter_4/item21-semver.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Cargo 在选择依赖项的版本时,会在符合条件的版本中选择最
[第 25 条]: ./item25-dep-graph.md
[第 26 条]: ./item26-features.md
[第 31 条]: ../chapter_5/item31-use-tools.md
[第 32 条]: https://www.lurklurk.org/effective-rust/ci.html
[第 32 条]: ../chapter_5/item32-ci.md
[第 35 条]: ../chapter_6/item35-bindgen.md
[官方文档]:https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html
[官方文档_semver_summary]: https://semver.org/#summary
Expand Down
33 changes: 2 additions & 31 deletions src/chapter_4/item25-dep-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ dep-graph v0.1.0
[Item 24]: ./item24-re-export.md
[Item 26]: ./item26-features.md
[Item 31]: ../chapter_5/item31-use-tools.md
[Item 32]: https://www.lurklurk.org/effective-rust/ci.html
[Item 33]: https://www.lurklurk.org/effective-rust/no-std.html
[Item 32]: ../chapter_5/item32-ci.md
[Item 33]: ../chapter_6/item33-no-std.md
[Item 34]: https://www.lurklurk.org/effective-rust/ffi.html
[alternate registry]: https://doc.rust-lang.org/cargo/reference/registries.html
[frowned upon]: https://rust-lang.github.io/rfcs/3463-crates-io-policy-update.html
Expand All @@ -169,32 +169,3 @@ dep-graph v0.1.0
[typo]: https://en.wikipedia.org/wiki/Typosquatting
[hijack]: https://eslint.org/blog/2018/07/postmortem-for-malicious-package-publishes/
[build.rs]: https://doc.rust-lang.org/cargo/reference/build-scripts.html





























5 changes: 2 additions & 3 deletions src/chapter_4/item26-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,5 @@ pub trait AsCbor: Sized {
[Item 13]: ../chapter_2/item13-use-default-impl.md
[Item 25]: ./item25-dep-graph.md
[Item 30]: ../chapter_5/item30-write-more-than-unit-tests.md
[Item 32]: https://www.lurklurk.org/effective-rust/ci.html
[Item 33]: https://www.lurklurk.org/effective-rust/no-std.html

[Item 32]: ../chapter_5/item32-ci.md
[Item 33]: ../chapter_6/item33-no-std.md
10 changes: 5 additions & 5 deletions src/chapter_5/item27-document-public-interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ pub fn intersection(
[Effective Java]: https://www.oreilly.com/library/view/effective-java-2nd/9780137150021/
[Rust book]: https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#making-useful-documentation-comments
[文档注释]: https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html
[第 13 条]: https://www.lurklurk.org/effective-rust/testing.html
[第 13 条]: ../chapter_2/item13-use-default-impl.md
[标准库]: https://doc.rust-lang.org/std/index.html
[第 32 条]: https://www.lurklurk.org/effective-rust/ci.html
[第 30 条]: https://www.lurklurk.org/effective-rust/testing.html
[第 32 条]: ./item32-ci.md
[第 30 条]: ./item30-write-more-than-unit-tests.md
[docs.rs]: https://docs.rs/
[第 1 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_1/item1-use-types.html
[第 21 条]: https://www.lurklurk.org/effective-rust/semver.html
[第 1 条]: ../chapter_1/item1-use-types.md
[第 21 条]: ../chapter_4/item21-semver.md
[最小惊讶原则]: https://en.wikipedia.org/wiki/Principle_of_least_astonishment
[点这里]: https://www.lurklurk.org/effective-rust/documentation.html
[Cargo.toml 中的 readme 字段]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-readme-field
34 changes: 17 additions & 17 deletions src/chapter_5/item29-listen-to-clippy.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ Clippy 的警告信息在你学习 Rust 时特别重要,因为它们可以揭
* [Unnecessarily converting `Result` to `Option`]
* [Opportunities to use `unwrap_or_default`]
* [第 3 条]同样建议了应当将错误返回给调用方。Clippy [指出了应当返回的地方]
* [第 5 条][建议]应当实现`From`特征而非`Into`
* [第 5 条]应当实现`From`特征而非`Into`
* [第 5 条]还描述了一些强制转换,而 Clippy 给出了如下的警告(对应的检查项默认是关掉的):
* [`as` casts that could be from instead]
* [`as` casts that could be from instead]
* [`as` casts that might truncate]
* [`as` casts that might wrap]
* [`as` casts that lose precision]
Expand Down Expand Up @@ -99,29 +99,29 @@ Clippy 的警告信息在你学习 Rust 时特别重要,因为它们可以揭
<!-- 参考链接 -->

[Microsoft Clippy]: https://en.wikipedia.org/wiki/Office_Assistant
[第 31 条]: https://www.lurklurk.org/effective-rust/use-tools.html
[第 31 条]: ./item31-use-tools.md
[Clippy]: https://github.com/rust-lang/rust-clippy#clippy
[第 32 条]: https://www.lurklurk.org/effective-rust/ci.html
[第 1 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_1/item1-use-types.html
[第 32 条]: ./item32-ci.md
[第 1 条]: ../chapter_1/item1-use-types.md
[函数参数]: https://rust-lang.github.io/rust-clippy/stable/index.html#/fn_params_excessive_bools
[结构体]: https://rust-lang.github.io/rust-clippy/stable/index.html#/struct_excessive_bools
[第 3 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_1/item3-transform.html
[第 3 条]: ../chapter_1/item3-transform.md
[Unnecessarily converting `Result` to `Option`]: https://rust-lang.github.io/rust-clippy/stable/index.html#/ok_expect
[Opportunities to use `unwrap_or_default`]: https://rust-lang.github.io/rust-clippy/stable/index.html#/unwrap_or_else_default
[应当返回的地方]: https://rust-lang.github.io/rust-clippy/stable/index.html#/unwrap_in_result
[第 5 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_1/item5-casts.html
[第 5 条]: ../chapter_1/item5-casts.md
[建议]: https://rust-lang.github.io/rust-clippy/stable/index.html#/from_over_into
[`as` casts that could be from instead]: https://rust-lang.github.io/rust-clippy/stable/index.html#/cast_lossless
[`as` casts that might truncate]: https://rust-lang.github.io/rust-clippy/stable/index.html#/cast_possible_truncation
[`as` casts that might wrap]: https://rust-lang.github.io/rust-clippy/stable/index.html#/cast_possible_wrap
[`as` casts that lose precision]: https://rust-lang.github.io/rust-clippy/stable/index.html#/cast_precision_loss
[`as` casts that might convert signed negative numbers to large positive numbers]: https://rust-lang.github.io/rust-clippy/stable/index.html#/cast_sign_loss
[any use of `as`]: https://rust-lang.github.io/rust-clippy/stable/index.html#/as_conversions
[第 8 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_1/item8-references&pointer.html
[第 8 条]: ../chapter_1/item8-references&pointer.md
[Holding a heap-allocated collection in a `Box`]: https://rust-lang.github.io/rust-clippy/stable/index.html#/box_collection
[Holding a heap-allocated collection of `Box` items]: https://rust-lang.github.io/rust-clippy/stable/index.html#/vec_box
[Taking a reference to a `Box`]: https://rust-lang.github.io/rust-clippy/stable/index.html#/borrowed_box
[第 9 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_1/item9-iterators.html
[第 9 条]: ../chapter_1/item9-iterators.md
[explicit_counter_loop]: https://rust-lang.github.io/rust-clippy/stable/index.html#/explicit_counter_loop
[explicit_iter_loop]: https://rust-lang.github.io/rust-clippy/stable/index.html#/explicit_iter_loop
[explicit_into_iter_loop]: https://rust-lang.github.io/rust-clippy/stable/index.html#/explicit_into_iter_loop
Expand All @@ -140,24 +140,24 @@ Clippy 的警告信息在你学习 Rust 时特别重要,因为它们可以揭
[suspicious_map]: https://rust-lang.github.io/rust-clippy/stable/index.html#/suspicious_map
[unnecessary_filter_map]: https://rust-lang.github.io/rust-clippy/stable/index.html#/unnecessary_filter_map
[unnecessary_fold]: https://rust-lang.github.io/rust-clippy/stable/index.html#/unnecessary_fold
[第 10 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_2/item10-std-traits.html
[第 10 条]: ../chapter_2/item10-std-traits.md
[`Ord` must agree with `PartialOrd`]: https://rust-lang.github.io/rust-clippy/stable/index.html#/derive_ord_xor_partial_ord
[`PartialEq::ne` should not need a nondefault implementation]: https://rust-lang.github.io/rust-clippy/stable/index.html#/partialeq_ne_impl
[第 13 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_2/item13-use-default-impl.html
[第 13 条]: ../chapter_2/item13-use-default-impl.md
[`Hash` and `Eq` must be consistent]: https://rust-lang.github.io/rust-clippy/stable/index.html#/derived_hash_with_manual_eq
[`Clone` for `Copy` types should match]: https://rust-lang.github.io/rust-clippy/stable/index.html#/expl_impl_clone_on_copy
[第 18 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_3/item18-panic.html
[第 18 条]: ../chapter_3/item18-panic.md
[`panic!`]: https://rust-lang.github.io/rust-clippy/stable/index.html#/panic
[`expect`]: https://rust-lang.github.io/rust-clippy/stable/index.html#/expect_used
[第 21 条]: https://www.lurklurk.org/effective-rust/semver.html
[第 21 条]: ../chapter_4/item21-semver.md
[进行了校验]: https://rust-lang.github.io/rust-clippy/stable/index.html#/wildcard_dependencies
[第 23 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_4/item23-wildcard.html
[第 25 条]: https://www.lurklurk.org/effective-rust/dep-graph.html
[第 23 条]: ../chapter_4/item23-wildcard.md
[第 25 条]: ../chapter_4/item25-dep-graph.md
[在问题出现时给出警告信息]: https://rust-lang.github.io/rust-clippy/stable/index.html#/multiple_crate_versions
[第 26 条]: https://www.lurklurk.org/effective-rust/features.html
[第 26 条]: ../chapter_4/item26-features.md
[“否定”的特性]: https://rust-lang.github.io/rust-clippy/stable/index.html#/negative_feature_names
[需要明确的特性名(如:"use-crate-x"形式的命名)]: https://rust-lang.github.io/rust-clippy/stable/index.html#/redundant_feature_names
[第 27 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_5/item27-document-public-interfaces.html
[第 27 条]: ./item27-document-public-interfaces.md
[Missing descriptions of `panic!`s]: https://rust-lang.github.io/rust-clippy/stable/index.html#/missing_panics_doc
[Missing descriptions]: https://rust-lang.github.io/rust-clippy/stable/index.html#/missing_safety_doc
[`unsafe` concerns]: https://rust-lang.github.io/rust-clippy/stable/index.html#/undocumented_unsafe_blocks
Expand Down
18 changes: 9 additions & 9 deletions src/chapter_5/item30-write-more-than-unit-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,13 @@ stack backtrace:
<!-- 参考链接 -->
[编写测试]: https://doc.rust-lang.org/book/ch11-00-testing.html
[第 23 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_4/item23-wildcard.html
[第 18 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_3/item18-panic.html
[第 28 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_5/item28-use-macros-judiciously.html
[第 27 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_5/item27-document-public-interfaces.html
[第 21 条]: https://www.lurklurk.org/effective-rust/semver.html
[第 32 条]: https://www.lurklurk.org/effective-rust/ci.html
[第 3 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_1/item3-transform.html
[第 23 条]: ../chapter_4/item23-wildcard.md
[第 18 条]: ../chapter_3/item18-panic.md
[第 28 条]: ./item28-use-macros-judiciously.md
[第 27 条]: ./item27-document-public-interfaces.md
[第 21 条]: ../chapter_4/item21-semver.md
[第 32 条]: ./item32-ci.md
[第 3 条]: ../chapter_1/item3-transform.md
[cargo test]: https://doc.rust-lang.org/cargo/commands/cargo-bench.html
[test]: https://doc.rust-lang.org/unstable-book/library-features/test.html
[Unstable Book]: https://doc.rust-lang.org/unstable-book/the-unstable-book.html
Expand All @@ -270,8 +270,8 @@ stack backtrace:
[test::bench::Bencher]: https://doc.rust-lang.org/test/bench/struct.Bencher.html
[AddressSanitizer]: https://clang.llvm.org/docs/AddressSanitizer.html
[ThreadSanitizer]: https://clang.llvm.org/docs/ThreadSanitizer.html
[第 16 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_3/item16-unsafe.html
[第 18 条]: https://rustx-labs.github.io/effective-rust-cn/chapter_3/item18-panic.html
[第 16 条]: ../chapter_3/item16-unsafe.md
[第 18 条]: ../chapter_3/item18-panic.md
[American fuzzy lop]: https://lcamtuf.coredump.cx/afl/
[libFuzzer]: https://llvm.org/docs/LibFuzzer.html
[cargo-fuzz]: https://github.com/rust-fuzz/cargo-fuzz
Expand Down
8 changes: 4 additions & 4 deletions src/chapter_5/item31-use-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ Rust 工具链的可扩展性不仅限于包元数据;编译器的抽象语法

<!-- 参考链接 -->
[第 16 条]: ../chapter_3/item16-unsafe.md
[第 21 条]: https://www.lurklurk.org/effective-rust/semver.html
[第 25 条]: https://www.lurklurk.org/effective-rust/dep-graph.html
[第 21 条]: ../chapter_4/item21-semver.html
[第 25 条]: ../chapter_4/item25-dep-graph.md
[第 27 条]: ./item27-document-public-interfaces.md
[第 28 条]: ./item28-use-macros-judiciously.md
[第 29 条]: ./item29-listen-to-clippy.md
[第 30 条]: https://www.lurklurk.org/effective-rust/testing.html
[第 32 条]: https://www.lurklurk.org/effective-rust/ci.html
[第 30 条]: ./item30-write-more-than-unit-tests.md
[第 32 条]: ./item32-ci.md
[第 35 条]: ../chapter_5/item31-use-tools.md

[cargo]: https://doc.rust-lang.org/cargo/
Expand Down
Loading

0 comments on commit 6c1b335

Please sign in to comment.