core :: str :: FromStr和std :: str :: FromStr之间有什么区别?

时间:2018-06-16 17:22:12

标签: rust

我发现Rust中有FromStr特征的两个定义。

std::str::FromStr

pub trait FromStr {
    type Err;
    fn from_str(s: &str) -> Result<Self, Self::Err>;
}

core::str::FromStr

pub trait FromStr: Sized {
    type Err;
    fn from_str(s: &str) -> Result<Self, Self::Err>;
}

Sized在第二个中意味着什么?它们之间有什么区别?

0 个答案:

没有答案