From f41a63da05f9df65160e1d6d1a8af2af41f9d1da Mon Sep 17 00:00:00 2001 From: Peter Byfield Date: Sun, 5 Jan 2025 09:01:45 +0100 Subject: [PATCH] Add some feature --- Cargo.toml | 4 ++++ Taskfile.yml | 4 ++-- src/lib.rs | 4 ++++ src/somefeature.rs | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 src/somefeature.rs diff --git a/Cargo.toml b/Cargo.toml index d3a78e1e..a7d1592d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,3 +29,7 @@ lazy_static = "1.5.0" [dev-dependencies] parameterized = "2.0.0" pretty_assertions = "1.4.1" + +[features] +default = [] +somefeature = [] \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 5891018f..ef0407d7 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -3,11 +3,11 @@ version: '3' tasks: test: cmds: - - cargo test + - cargo test --all-features clippy.check: cmds: - - cargo clippy --all-targets -- -D warnings + - cargo clippy --all-features --all-targets -- -D warnings clippy.fix: cmds: diff --git a/src/lib.rs b/src/lib.rs index cb9313d7..3baa4f17 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,3 +33,7 @@ pub mod prelude { pub use crate::IntoPypath; pub use crate::PackageItemIterator; } + +/// Some feature +#[cfg(feature = "somefeature")] +pub mod somefeature; diff --git a/src/somefeature.rs b/src/somefeature.rs new file mode 100644 index 00000000..2be69548 --- /dev/null +++ b/src/somefeature.rs @@ -0,0 +1,2 @@ +/// Foo +pub fn foo() {}