From ff9450dfd1e13efcfca1e166997bee2b1cc6ea07 Mon Sep 17 00:00:00 2001 From: Hussein Hazem Date: Tue, 1 Oct 2024 11:27:24 +0200 Subject: [PATCH] #5 add example crate feature to remove example code --- Cargo.toml | 5 ++++- src/lib.rs | 7 +++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bd4b1dc..eab96ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,10 @@ serde = { version = "1.0.197", features = ["derive"], default-features = false } mockall = "0.11.0" [features] -default = [] +default = ["example"] +# Mocks for doc examples +example = [] + strict = [] diff --git a/src/lib.rs b/src/lib.rs index 4464753..9314b46 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -83,14 +83,13 @@ extern crate alloc; pub mod can; pub mod config; -pub mod status; - +#[cfg(feature = "example")] +pub mod example; pub mod filter; pub mod message; - -pub mod example; #[cfg(test)] pub(crate) mod mocks; mod registers; +pub mod status; #[cfg(test)] mod tests;