-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
35: Add `num_traits` proc_macro helper for explicit import r=cuviper a=jean-airoldie This allows the user to specify a identifier for the `num_traits` crate so that the proc_macros can directly depend in it. This is usefull when reexporting `num-derive` and using `num-trait` as a transitive import. Fixes #34. CC. @vglavnyy Co-authored-by: jean-airoldie <[email protected]> Co-authored-by: Josh Stone <[email protected]>
- Loading branch information
Showing
8 changed files
with
414 additions
and
314 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 |
---|---|---|
|
@@ -19,7 +19,7 @@ quote = "1" | |
syn = "1" | ||
|
||
[dev-dependencies] | ||
num = "0.2" | ||
num = "0.3" | ||
num-traits = "0.2" | ||
|
||
[features] | ||
|
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ authors = ["Josh Stone <[email protected]>"] | |
edition = "2018" | ||
|
||
[dependencies.num-derive] | ||
path = ".." | ||
path = "../.." | ||
|
||
[dependencies.num-traits] | ||
version = "0.2" | ||
|
File renamed without changes.
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.3", 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
Oops, something went wrong.