Skip to content

Commit 90054cf

Browse files
committed
(Maybe) fix macro compatibility for older Rusts
1 parent 3d8f88f commit 90054cf

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ language: rust
22
cache: cargo
33

44
rust:
5+
- stable
6+
- beta
7+
- nightly
8+
9+
# The five most recent stable releases before "stable"
510
- 1.10.0
611
- 1.11.0
712
- 1.12.1
813
- 1.13.0
914
- 1.14.0
10-
- stable
11-
- beta
12-
- nightly
1315

1416
matrix:
1517
allow_failures:

src/macros/scalar.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ usable as arguments and default values.
3838
*/
3939
#[macro_export]
4040
macro_rules! graphql_scalar {
41+
( @as_expr, $e:expr) => { $e };
42+
4143
// Calls $val.$func($arg) if $arg is not None
4244
( @maybe_apply, None, $func:ident, $val:expr ) => { $val };
4345
( @maybe_apply, $arg:tt, $func:ident, $val:expr ) => { $val.$func($arg) };
@@ -65,7 +67,7 @@ macro_rules! graphql_scalar {
6567
type Context = ();
6668

6769
fn name() -> Option<&'static str> {
68-
Some($outname)
70+
Some(graphql_scalar!( @as_expr, $outname ))
6971
}
7072

7173
fn meta<'r>(registry: &mut $crate::Registry<'r>) -> $crate::meta::MetaType<'r> {

0 commit comments

Comments
 (0)