Open mo-rijndael opened 2 years ago
Also came here to argue in favor of this.
additional context: https://github.com/gakonst/ethers-rs/issues/2175
add codegen for ToString, which will return full version of hash
Wouldn't the alternate solution also be a breaking change? If somebody already is using to_string() and counts that it will only give him the shortened version? Just curious.
If we could get this changed it would be great IMO.
How to reproduce
here is snippet
Expected results
to_string()
returns string representation of H160Real results
to_string()
returns shortened versionSource of problem
This occurs due to default implementation of
ToString
in standard library:impl<T: Display + ?Sized> ToString for T
Proposed solution
swap realizations for
Debug
andDisplay
Advantages
Display
-ing to user we usually need full hash.)Disadvantages
Alternative solution
add codegen for
ToString
, which will return full version of hashAdvantages
Disadvantage