2 ms·
The method `from_str` is from the FromStr trait. [1] The `parse` function only works on types that implement FromStr. It's "special" in that it's the convention
by ucarion 10y ago
The method `from_str` is from the FromStr trait. [1] The `parse` function only works on types that implement FromStr. It's "special" in that it's the conventional way to do things, but the compiler does not treat FromStr specially.
[1]: https://doc.rust-lang.org/std/str/trait.FromStr.html https://doc.rust-lang.org/std/str/trait.FromStr.html