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

Support compact encoding for tuple enum items #262

Closed
gavofyork opened this issue Apr 4, 2021 · 2 comments
Closed

Support compact encoding for tuple enum items #262

gavofyork opened this issue Apr 4, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@gavofyork
Copy link
Member

This builds:

pub enum Example {
  Item { #[codec(compact)] x: u32 },
}

Yet this doesn't:

pub enum Example {
  Item ( #[codec(compact)] u32 ),
}
@gui1117
Copy link
Contributor

gui1117 commented Apr 26, 2021

It should work already

#[derive(Debug, PartialEq, Encode, Decode)]
enum TestCompactAttributeEnum {
Unnamed(#[codec(compact)] u64),
Named {
#[codec(compact)]
bar: u64,
},
}

I tried the example you provided and it worked to me.

@gui1117
Copy link
Contributor

gui1117 commented Apr 27, 2021

tests cover the case and tests that it is indeed compact. thus I think we can close it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants