Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion guides/the-ultimate-guide-to-rust-newtypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ Well, `FromStr` came first. It predates the addition of `TryFrom` to the standar
Whether you choose to implement `FromStr` in addition to `From` or `TryFrom` depends on three things:

- Whether you're interfacing with older code that has parameters bounded by `FromStr`, in which case you have no choice but to implement it for your newtype.
- Whether you want to take advantage of imnplementations over `FromStr` types, like [`str::parse`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.parse) and [`serde_with::DeserializeFromStr`](https://docs.rs/serde_with/latest/serde_with/derive.DeserializeFromStr.html).
- Whether you want to take advantage of implementations over `FromStr` types, like [`str::parse`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.parse) and [`serde_with::DeserializeFromStr`](https://docs.rs/serde_with/latest/serde_with/derive.DeserializeFromStr.html).
- Personal preference.

In the latter case, _be consistent_. Whatever your team decides, document it and use a linter to enforce your choice, because none of you can be trusted to remember.
Expand Down