Skip to content

Commit

Permalink
Re-export log to prevent having to add peer-dep
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Hertleif committed Jun 21, 2019
1 parent 4bb0bb4 commit d5b2bfb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ repository = "https://github.com/pest-parser/pest_deconstruct"
[dependencies]
void = "1.0"
pest = "2.0"
log = "0.4.6"

[dev-dependencies]
pest_derive = "2.0"
Expand Down
3 changes: 2 additions & 1 deletion derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ pest = "2.0"
pest_derive = "2.0"

[features]
trace = [] # enabling this will require you to add `log` as a dependency to _your_ crate
default = ["trace"]
trace = []
2 changes: 1 addition & 1 deletion derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mod from_pest;

#[cfg(feature = "trace")]
fn trace(t: proc_macro2::TokenStream) -> proc_macro2::TokenStream {
quote! { ::log::trace!( #t ); }
quote! { ::from_pest::log::trace!( #t ); }
}

#[cfg(not(feature = "trace"))]
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#[doc(hidden)]
pub extern crate pest;
extern crate void;
#[doc(hidden)]
pub extern crate log;

#[doc(inline)]
pub use void::Void;
Expand Down

0 comments on commit d5b2bfb

Please sign in to comment.