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

Allow arg_enum! to work with #[repr(c)] #543

Closed
lilith opened this issue Jun 25, 2016 · 2 comments
Closed

Allow arg_enum! to work with #[repr(c)] #543

lilith opened this issue Jun 25, 2016 · 2 comments
Labels
C-enhancement Category: Raise on the bar on expectations

Comments

@lilith
Copy link

lilith commented Jun 25, 2016

Goal: make this possible:

arg_enum!{
    #[repr(C)]
    #[derive(Copy,Clone)]
    pub enum Filter { A=0, B = 1}
}

I have an enum with 30 variants, or manually implementing from_str would be obvious.

@kbknapp
Copy link
Member

kbknapp commented Jun 25, 2016

Thanks for filing this. This should be a very quick fix, I'll see if I can knock it out when I get home tonight.

@lilith
Copy link
Author

lilith commented Jun 25, 2016

No rush! Just a convenience thing, I have a workaround.
On Jun 25, 2016 1:21 PM, "Kevin K." notifications@github.com wrote:

Thanks for filing this. This should be a very quick fix, I'll see if I can
knock it out when I get home tonight.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#543 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAGln0HEsYJwIASIM25BTzqe0e7YbRF4ks5qPX-0gaJpZM4I-Z3w
.

@kbknapp kbknapp added C-enhancement Category: Raise on the bar on expectations P4: nice to have labels Jun 26, 2016
kbknapp added a commit that referenced this issue Jun 28, 2016
One can now use more than one meta item, and things like `#[repr(C)]`

Example:

```rust

arg_enum! {
	#[repr(C)]
	#[derive(Debug)]
	pub enum MyEnum {
		A=1,
		B=2
	}
}

```

Closes #543
homu added a commit that referenced this issue Jun 28, 2016
imp(arg_enum!): allows using meta items like repr(C) with arg_enum!s

One can now use more than one meta item, and things like `#[repr(C)]`

Example:

```rust

arg_enum! {
	#[repr(C)]
	#[derive(Debug)]
	pub enum MyEnum {
		A=1,
		B=2
	}
}

```

Closes #543
homu added a commit that referenced this issue Jun 28, 2016
imp(arg_enum!): allows using meta items like repr(C) with arg_enum!s

One can now use more than one meta item, and things like `#[repr(C)]`

Example:

```rust

arg_enum! {
	#[repr(C)]
	#[derive(Debug)]
	pub enum MyEnum {
		A=1,
		B=2
	}
}

```

Closes #543
@homu homu closed this as completed in #544 Jun 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

2 participants