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

replace DisplayHardforks with Box<dyn Display> #12219

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

stevencartavia
Copy link
Contributor

Resolves #12208

@stevencartavia stevencartavia marked this pull request as ready for review October 31, 2024 01:49
fn display_hardforks(&self) -> DisplayHardforks {
self.display_hardforks()
fn display_hardforks(&self) -> Box<dyn Display> {
Box::new(self.display_hardforks())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Box::new(self.display_hardforks())
self.display_hardforks().boxed()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no method named boxed for struct Box<(dyn derive_more::Display + 'static)>.
Let me know if I should add something like pub fn boxed(self) -> Box<dyn Hardfork> { Box::new(self) } somewhere.

Copy link
Collaborator

@joshieDo joshieDo Oct 31, 2024

Choose a reason for hiding this comment

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

ChainSpec::display_forks (not the trait impl) could still return the type DisplayHardforks which would have a boxed method called here

crates/chainspec/src/api.rs Outdated Show resolved Hide resolved
@mattsse mattsse added this pull request to the merge queue Oct 31, 2024
Merged via the queue into paradigmxyz:main with commit bd8c4ec Oct 31, 2024
40 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.

replace DisplayHardforks with Box< dyn Display>
3 participants