Skip to content

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

Closed
rajanarahul93 wants to merge 1 commit intobitcoindevkit:masterfrom
rajanarahul93:fix-display-debug
Closed

fix(wallet): Remove Debug formatting from Display implementation #1868#1919
rajanarahul93 wants to merge 1 commit intobitcoindevkit:masterfrom
rajanarahul93:fix-display-debug

Conversation

@rajanarahul93
Copy link
Copy Markdown

@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
Copy Markdown
Collaborator

This looks like a repeat of #1881

@rajanarahul93
Copy link
Copy Markdown
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
Copy Markdown
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

Archived in project

Development

Successfully merging this pull request may close these issues.

Display implementations should not expose Debug output

5 participants