(Maybe) fix macro compatibility for older Rusts
This commit is contained in:
parent
3d8f88f59e
commit
90054cf9d1
2 changed files with 8 additions and 4 deletions
|
@ -2,14 +2,16 @@ language: rust
|
|||
cache: cargo
|
||||
|
||||
rust:
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
|
||||
# The five most recent stable releases before "stable"
|
||||
- 1.10.0
|
||||
- 1.11.0
|
||||
- 1.12.1
|
||||
- 1.13.0
|
||||
- 1.14.0
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
|
|
|
@ -38,6 +38,8 @@ usable as arguments and default values.
|
|||
*/
|
||||
#[macro_export]
|
||||
macro_rules! graphql_scalar {
|
||||
( @as_expr, $e:expr) => { $e };
|
||||
|
||||
// Calls $val.$func($arg) if $arg is not None
|
||||
( @maybe_apply, None, $func:ident, $val:expr ) => { $val };
|
||||
( @maybe_apply, $arg:tt, $func:ident, $val:expr ) => { $val.$func($arg) };
|
||||
|
@ -65,7 +67,7 @@ macro_rules! graphql_scalar {
|
|||
type Context = ();
|
||||
|
||||
fn name() -> Option<&'static str> {
|
||||
Some($outname)
|
||||
Some(graphql_scalar!( @as_expr, $outname ))
|
||||
}
|
||||
|
||||
fn meta<'r>(registry: &mut $crate::Registry<'r>) -> $crate::meta::MetaType<'r> {
|
||||
|
|
Loading…
Reference in a new issue