我发现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
在第二个中意味着什么?它们之间有什么区别?