Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use
*self
in fmt::Display
implementation for `ParsePublicKey…
…Error` The `fmt` method in `fmt::Display` takes `&self` as a shared reference. To pattern match on the enum variants, we can dereference `self` to access the underlying value (`ParsePublicKeyError`) instead of matching on the reference. This fix changed the match block from `self` to `*self` to explicitly pattern match the enum variants directly as is done in other error code. Without dereferencing, the match works with `&ParsePublicKeyError`, causing mismatched types. Even though non-exact type matching is supported in this codebase, we tend to be explicit when pattern matching. This update improves the readability and correctness of the `fmt::Display` implementation.
- Loading branch information