Created
November 30, 2018 02:55
-
-
Save Korvox/521af158c49f1a14ab83155a5448a554 to your computer and use it in GitHub Desktop.
Gets cannot find `__req` & '__data' in this scope errors
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
#![feature(proc_macro_hygiene, decl_macro)] | |
#[macro_use] | |
extern crate rocket; | |
macro_rules! index { | |
($type:ty) => { | |
#[get("/")] | |
fn index(thing: rocket::State<$type>) -> String { | |
format!("Thing: {}", *thing) | |
} | |
} | |
} | |
index!(i32); | |
fn main() { | |
rocket::ignite().manage::<i32>(42).mount("/", routes![index]).launch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment