Skip to content
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

impl Display for Receipt #901

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

rafal-ch
Copy link
Contributor

@rafal-ch rafal-ch commented Jan 21, 2025

This PR implements Display for Receipt for easier logging.

Once this is merged and released, there will be a follow-up PR to the fuel-core to get rid of this boilerplate.

Follow-up PR: FuelLabs/fuel-core#2616

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests
  • If performance characteristic of an instruction change, update gas costs as well or make a follow-up PR for that
  • The specification matches the implemented behavior (link update PR if changes are needed)

Before requesting review

  • I have reviewed the code myself

@@ -156,6 +156,51 @@ pub enum Receipt {
},
}

impl core::fmt::Display for Receipt {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why can't we derive the implementation with all fields?=D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding all fields - I thought it may be just a bit too much details, which, when needed, could be retrieved by Debug. I prefer Display to be more concise, targeted on humans, not developers :)

I have no strong opinions here, so if you prefer to have all fields, I can just stick derive_more::Display without any custom #[display(fmt = attributes.

Let me know what you think.

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.

2 participants