Merge pull request #567 from Rustln/main

Fixed `cargo test` panic!
pull/568/head
Sunface 3 years ago committed by GitHub
commit ab2b124a87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -323,7 +323,7 @@ impl<T> AsyncReceiver<T> {
除了跳转到标准库,你还可以通过指定具体的路径跳转到自己代码或者其它库的指定项,例如在 `lib.rs` 中添加以下代码:
```rust
mod a {
pub mod a {
/// `add_one` 返回一个[`Option`]类型
/// 跳转到[`crate::MySpecialFormatter`]
pub fn add_one(x: i32) -> Option<i32> {
@ -331,7 +331,7 @@ mod a {
}
}
struct MySpecialFormatter;
pub struct MySpecialFormatter;
```
使用 `crate::MySpecialFormatter` 这种路径就可以实现跳转到 `lib.rs` 中定义的结构体上。
@ -429,7 +429,7 @@ pub mod utils {
/// ```rust
/// use art::utils::mix;
/// use art::kinds::{PrimaryColor,SecondaryColor};
/// assert_eq!(mix(PrimaryColor::Yellow, PrimaryColor::Blue), SecondaryColor::Green)
/// assert!(matches!(mix(PrimaryColor::Yellow, PrimaryColor::Blue), SecondaryColor::Green));
/// ```
pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
SecondaryColor::Green

Loading…
Cancel
Save