diwakergupta / stacks-blockchain-tob-audit

GNU General Public License v3.0
0 stars 0 forks source link

`ToString` implemented when `Display` should be implemented #4

Open smoelius opened 4 years ago

smoelius commented 4 years ago

Some types feature a to_string method. Example: https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/chainstate/stacks/index/mod.rs#L101-L112 This is morally equivalent to implementing the ToString trait. But the documentation for that trait states:

This trait is automatically implemented for any type which implements the Display trait. As such, ToString shouldn't be implemented directly: Display should be implemented instead, and you get the ToString implementation for free.