mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-23 04:52:28 +00:00
weird proc macro issue
This commit is contained in:
parent
df3b735429
commit
2c31251cb2
3 changed files with 6 additions and 10 deletions
|
@ -70,6 +70,9 @@ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS LICENSE.
|
|||
[serde_json]: https://github.com/serde-rs/json#serde-json----
|
||||
*/
|
||||
|
||||
// weird proc macro issue
|
||||
extern crate self as gotham_restful;
|
||||
|
||||
#[macro_use] extern crate gotham_derive;
|
||||
#[macro_use] extern crate serde;
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ This can be returned from a resource when there is no cause of an error. For exa
|
|||
```
|
||||
# #[macro_use] extern crate gotham_restful_derive;
|
||||
# use gotham::state::State;
|
||||
# use gotham_restful::Success;
|
||||
# use gotham_restful::*;
|
||||
# use serde::{Deserialize, Serialize};
|
||||
#
|
||||
# #[derive(Resource)]
|
||||
|
@ -125,6 +125,7 @@ the function attributes:
|
|||
```
|
||||
# #[macro_use] extern crate gotham_restful_derive;
|
||||
# use gotham::state::State;
|
||||
# use gotham_restful::*;
|
||||
#
|
||||
# #[derive(Resource)]
|
||||
# struct MyResource;
|
||||
|
|
|
@ -3,7 +3,6 @@ extern crate proc_macro;
|
|||
use proc_macro::TokenStream;
|
||||
use proc_macro2::TokenStream as TokenStream2;
|
||||
use quote::quote;
|
||||
use std::env;
|
||||
|
||||
mod method;
|
||||
use method::{expand_method, Method};
|
||||
|
@ -14,14 +13,7 @@ mod openapi_type;
|
|||
|
||||
fn krate() -> TokenStream2
|
||||
{
|
||||
if env::var("CARGO_PKG_NAME").unwrap() == "gotham_restful"
|
||||
{
|
||||
quote!(crate)
|
||||
}
|
||||
else
|
||||
{
|
||||
quote!(::gotham_restful)
|
||||
}
|
||||
quote!(::gotham_restful)
|
||||
}
|
||||
|
||||
#[cfg(feature = "openapi")]
|
||||
|
|
Loading…
Add table
Reference in a new issue