Skip to content

Conversation

@tcoratger
Copy link
Contributor

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

having these is very useful because usually we need to call them conditionally which because slightly ugly with with the consuming builder functions.

can we also add an fn apply{_mut}<F: FnOnce(Self) -> Self>(self, f)

}

/// Set address info of BundleState state.
pub fn set_state_address(&mut self, address: Address) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

since this is a builder type, we can return &mut Self on these functions so they can be chained

the existing self functions should then reuse the &mut self ones so we don't duplicate the actual impl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, let me know if this is ok for you

@rakita rakita merged commit dd98b3b into bluealloy:main Jun 16, 2024
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.

3 participants