Skip to content

Implement core::fmt::Display for HumanReadableName #3829

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

Merged

Conversation

chuksys
Copy link
Contributor

@chuksys chuksys commented Jun 5, 2025

Closes #3823

This PR implements Display for HumanReadableName which allows us to print a HRN as ₿user@domain.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jun 5, 2025

👋 Thanks for assigning @TheBlueMatt as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tnull tnull self-requested a review June 5, 2025 07:25
Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically LGTM, one comment.

@@ -287,6 +287,12 @@ impl Readable for HumanReadableName {
}
}

impl std::fmt::Display for HumanReadableName {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we want to keep this crate no_std-compatible, please use core::fmt instead of std::fmt. Any uses of std would need to be feature-gated behind the std feature, but in this case there is no reason to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay will do, thanks!

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@tnull tnull requested a review from TheBlueMatt June 5, 2025 07:28
@chuksys chuksys changed the title Implement std::fmt::Display for HumanReadableName Implement core::fmt::Display for HumanReadableName Jun 5, 2025
@chuksys chuksys force-pushed the implement-display-for-hrn branch from 209f0f2 to 004937b Compare June 5, 2025 07:37
@TheBlueMatt
Copy link
Collaborator

Feel free to squash the fixups, which should fix CI.

@chuksys chuksys force-pushed the implement-display-for-hrn branch from 004937b to 3484eb0 Compare June 5, 2025 13:26
@chuksys
Copy link
Contributor Author

chuksys commented Jun 5, 2025

I think I need to add a test case that asserts the correct HRN display format, for mutation testing to pass in CI.

@chuksys chuksys force-pushed the implement-display-for-hrn branch from 3484eb0 to 81b201a Compare June 5, 2025 15:01
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TheBlueMatt TheBlueMatt merged commit 35748f6 into lightningdevkit:main Jun 6, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Display for HumanReadableName
4 participants