Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gets cannot find `__req` & '__data' in this scope errors
#![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