Skip to content

Commit

Permalink
Rename proc-macro related crates
Browse files Browse the repository at this point in the history
  • Loading branch information
Meralis40 committed Sep 8, 2017
1 parent 1570732 commit 9119358
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ lto = true
[workspace]
members = [
"lib/",
"shio-macro",
"macros/",
"examples/hello",
"examples/json",
"examples/proxy",
"examples/stateful",
"examples/redirect",
"examples/templates_askama",
"examples/postgres",
"examples/hello_macro",
"examples/hello_macros",
]
8 changes: 0 additions & 8 deletions examples/hello_macro/Cargo.toml

This file was deleted.

7 changes: 7 additions & 0 deletions examples/hello_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "hello_macros"
version = "0.0.0"
workspace = "../.."

[dependencies]
shio = { path = "../../lib", features=["nightly"] }
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#![feature(proc_macro)]

extern crate shio;
extern crate shio_macro;
use shio_macro::*;

use shio::prelude::*;

Expand Down
4 changes: 3 additions & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ regex = "0.2"
log = "0.3"
typemap = "0.3"

shio_macros = { path="../macros", optional=true }

[features]
default = []
nightly = []
nightly = ["shio_macros"]
10 changes: 10 additions & 0 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![cfg_attr(feature = "cargo-clippy", warn(clippy, clippy_pedantic))]
#![cfg_attr(feature = "cargo-clippy", allow(missing_docs_in_private_items))]
#![cfg_attr(feature = "nightly", feature(proc_macro))]

extern crate futures;
extern crate hyper;
Expand All @@ -12,6 +13,9 @@ extern crate tokio_core;
extern crate tokio_io;
extern crate typemap;

#[cfg(feature = "nightly")]
extern crate shio_macros;

pub mod context;
mod handler;
mod shio;
Expand All @@ -30,11 +34,17 @@ pub use shio::Shio;
pub use context::Context;
pub use handler::Handler;

#[cfg(feature = "nightly")]
pub use shio_macros::{get, post};

/// Re-exports important traits and types. Meant to be glob imported when using Shio.
pub mod prelude {
pub use super::{header, Context, Method, Request, Response, Shio, StatusCode};
pub use super::router::Parameters;

pub use futures::{Future, IntoFuture};
pub use ext::{BoxFuture, FutureExt};

#[cfg(feature = "nightly")]
pub use shio_macros::{get, post};
}
2 changes: 1 addition & 1 deletion shio-macro/Cargo.toml → macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "shio-macro"
name = "shio_macros"
version = "0.1.0"
authors = ["Quentin Laveau <qlaveau@gmail.com>"]
workspace = ".."
Expand Down
File renamed without changes.

0 comments on commit 9119358

Please sign in to comment.