From 3031bd7cb098f96165199cf4c1859688c47c01a6 Mon Sep 17 00:00:00 2001 From: Tim Kuehn Date: Tue, 12 Jan 2016 20:23:00 -0800 Subject: [PATCH] Require rpc fns to be written in anticipation of allowing arbitrary items in the generated module --- tarpc/src/lib.rs | 4 ++-- tarpc/src/macros.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tarpc/src/lib.rs b/tarpc/src/lib.rs index 8784f6c..64789aa 100644 --- a/tarpc/src/lib.rs +++ b/tarpc/src/lib.rs @@ -9,8 +9,8 @@ //! # #[macro_use] extern crate tarpc; //! # extern crate serde; //! rpc_service!(my_server: -//! hello(name: String) -> String; -//! add(x: i32, y: i32) -> i32; +//! rpc hello(name: String) -> String; +//! rpc add(x: i32, y: i32) -> i32; //! ); //! //! use self::my_server::*; diff --git a/tarpc/src/macros.rs b/tarpc/src/macros.rs index 7ee6123..b12433d 100644 --- a/tarpc/src/macros.rs +++ b/tarpc/src/macros.rs @@ -49,7 +49,7 @@ macro_rules! request_variant { // The main macro that creates RPC services. #[macro_export] macro_rules! rpc_service { ($server:ident: - $( $fn_name:ident( $( $arg:ident : $in_:ty ),* ) -> $out:ty;)*) => { + $( rpc $fn_name:ident( $( $arg:ident : $in_:ty ),* ) -> $out:ty;)*) => { #[doc="A module containing an rpc service and client stub."] pub mod $server { @@ -116,9 +116,9 @@ macro_rules! rpc_service { ($server:ident: #[allow(dead_code)] mod test { rpc_service!(my_server: - hello(foo: super::Foo) -> super::Foo; + rpc hello(foo: super::Foo) -> super::Foo; - add(x: i32, y: i32) -> i32; + rpc add(x: i32, y: i32) -> i32; ); use self::my_server::*; @@ -154,6 +154,6 @@ mod test { // This is a test of a service with a fn that takes no args rpc_service! {foo: - hello() -> String; + rpc hello() -> String; } }