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

lang: Associated account attribute #186

Merged
merged 2 commits into from
Apr 13, 2021
Merged

Conversation

armaniferrante
Copy link
Member

@armaniferrante armaniferrante commented Apr 13, 2021

Addresses #185.

#[account]
pub struct Data {
udata: u128,
idata: i128,
}

#[account]
#[derive(Default)]
Copy link
Member Author

Choose a reason for hiding this comment

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

One open question is whether we want to force #[account]s to implement Default. For now, we'll leave it out, although aesthetically unpleasant.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is solved by a new #[associated] attribute to replace account, in the associated account instance.

@armaniferrante armaniferrante marked this pull request as ready for review April 13, 2021 18:40
@armaniferrante armaniferrante merged commit b498b99 into master Apr 13, 2021
@armaniferrante armaniferrante deleted the armani/associated branch April 13, 2021 18:47
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.

1 participant