Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/target
/Cargo.lock
25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ keywords = ["macros", "myn"]
categories = ["development-tools::procedural-macro-helpers", "parser-implementations"]
license = "MIT"

[dependencies]
# No dependencies!
[features]
default = []
testing = ["proc-macro"]

[dependencies.proc-macro]
package = "proc-macro2"
version = "1"
optional = true

[dev-dependencies]
proc_macro = { package = "proc-macro2", version = "1" }
18 changes: 16 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@
//!
//! The [`onlyargs`] and [`onlyerror`] crates are good examples of how to use the library.
//!
//! # Feature Flags
//!
//! - `testing`: Enable the use of `myn` in unit tests with `proc-macro2`. This allows for testing
//! scenarios at the expense of build times. The recommended way to use this feature flag is to
//! enable it only in the `[dev-dependencies]` table:
//!
//! ```toml
//! [dependencies]
//! myn = "0.1"
//!
//! [dev-dependencies]
//! myn = { features = ["testing"] }
//! ```
//!
//! [benchmarks]: https://github.com/parasyte/myn/blob/main/benchmarks.md
//! [`onlyargs`]: https://github.com/parasyte/onlyargs
//! [`onlyerror`]: https://github.com/parasyte/onlyerror
Expand All @@ -39,9 +53,9 @@
#![forbid(unsafe_code)]
#![deny(clippy::all)]
#![deny(clippy::pedantic)]
#![cfg_attr(test, allow(clippy::cmp_owned))]
#![cfg_attr(any(test, feature = "testing"), allow(clippy::cmp_owned))]

#[cfg(not(test))]
#[cfg(not(all(test, feature = "testing")))]
extern crate proc_macro;

pub mod prelude;
Expand Down