refactor: Use regular functions rather than FromStr impls#8178
Conversation
Implementing `FromStr` and then calling `parse()` creates an indirection, which is hard to follow for people who are not familiar with Rust. r10s recently had this problem.
3b56774 to
04786f8
Compare
|
Note about not using I looked at Lines 522 to 524 in 287d730 The code actually called is here: Lines 53 to 64 in 287d730 Implementing |
|
thanks a lot for that ❤️ |
Follow-up to #8178 (comment) In a previous version, I added a note that the JsonRPC API is a notable exception, but I removed it.
Implementing
FromStrand then callingparse()creates anindirection, which is hard to follow for people who are not familiar
with Rust. @r10s recently voiced this problem when we were pair-programming, and I agree.
We can decide what exactly to call the new function.
I didn't remove all
FromStrimplementations yet;FromStr for Fingerprint,FromStr for Params,FromStr for MozConfigTagandFromStr for EphemeralTimerare still left.