Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

offchain: adjust code to avoid some clippy warnings #211

Closed
wants to merge 2 commits into from

Conversation

marcelstanley
Copy link
Contributor

@marcelstanley marcelstanley commented Jul 27, 2023

I have no strong opinions about the changes made at 2657bd5 to the State sub-types to meet new_ret_no_self. We can easily dispense with it and move forward if you prefer.

As stated at cartesi/rollups-node#37 (comment), we're still going to miss changes to meet module_inception. Also, as mentioned at cartesi/rollups-node#37 (comment), I see no reason to fix too_many_arguments warning.

Closes cartesi/rollups-node#37

@marcelstanley marcelstanley requested review from renan061 and a team July 27, 2023 21:13
@marcelstanley marcelstanley self-assigned this Jul 27, 2023
@@ -271,7 +271,7 @@ struct IdleState {
}

impl IdleState {
fn new(data: SharedStateData) -> Box<dyn State> {
fn create(data: SharedStateData) -> Box<dyn State> {
Box::new(Self { data })
}
}
Copy link
Contributor

@renan061 renan061 Jul 31, 2023

Choose a reason for hiding this comment

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

To avoid using create, we can change this to:

impl IdleState {
    fn new(data: SharedStateData) -> Self {
        Self { data }
    }
}

And then we can do:

Some(Box::new(IdleState::new(self.data)))

@@ -396,7 +396,7 @@ struct InspectState {
}

impl InspectState {
fn new(
fn create(
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for this other guys.

What do you think?

@marcelstanley
Copy link
Contributor Author

Obsoleted by cartesi/rollups-node#47

@marcelstanley marcelstanley deleted the fix/clippy-outstanding branch August 1, 2023 00:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants