-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
num_traits
proc_macro helper for explicit import
This allows the user to specify a identifier for the `num_traits` crate so that the proc_macro can directly depend in it. This is usefull when reexporting `num-derive` and using `num-trait` as a transitive import. Fixes #34.
- Loading branch information
1 parent
1b361d7
commit 114944a
Showing
5 changed files
with
458 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "import" | ||
version = "0.0.1" | ||
authors = ["jean-airoldie <[email protected]>"] | ||
edition = "2018" | ||
publish = false | ||
|
||
[dependencies] | ||
num-derive = { path = "../" } | ||
num = { version = "0.2", default-features = false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#[macro_use] | ||
extern crate num_derive; | ||
|
||
#[derive( | ||
Debug, | ||
Clone, | ||
Copy, | ||
PartialEq, | ||
PartialOrd, | ||
ToPrimitive, | ||
FromPrimitive, | ||
)] | ||
#[num_traits = "num"] | ||
#[repr(u8)] | ||
enum Rgb { | ||
Red = 0, | ||
Green = 1, | ||
Black = 2, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("Hello, world!"); | ||
} |
Oops, something went wrong.