Skip to content

fix(wallet): Remove Debug formatting from Display implementation #1868 #1919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

rajanarahul93
Copy link

@rajanarahul93 rajanarahul93 commented Mar 29, 2025

Description

This PR removes the Debug formatting from the Display implementation for LoadError in crates/wallet/src/wallet/mod.rs.
Instead of using {:?} (which invokes Debug formatting), we now use {} to provide a more user-friendly error message.
This change improves readability and aligns with best practices for Display implementations.

Notes to the reviewers

  • The LoadError::Mismatch message was updated to explicitly state "expected X, but found Y", making it clearer.
  • The LoadError::MissingDescriptor message now displays the keychain value using {} instead of {:?}, ensuring a more user-friendly output.

Changelog notice

  • Fixed: Removed Debug formatting from Display implementation in LoadError for better readability.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

resolves #1933

@ValuedMammal ValuedMammal added the duplicate This issue or pull request already exists label Mar 31, 2025
@ValuedMammal
Copy link
Collaborator

This looks like a repeat of #1881

@rajanarahul93
Copy link
Author

@ValuedMammal, I will check the #1881 PR and make the required changes!!

@notmandatory notmandatory moved this to Discussion in BDK Wallet Mar 31, 2025
@luisschwab
Copy link
Member

This can be closed.

@evanlinjin evanlinjin closed this Apr 10, 2025
@github-project-automation github-project-automation bot moved this from Discussion to Done in BDK Wallet Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Display implementations should not expose Debug output
4 participants