Skip to content

Commit

Permalink
Run the document-features only on docsrs
Browse files Browse the repository at this point in the history
  • Loading branch information
palfrey committed Feb 12, 2022
1 parent b840cfd commit b981a9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion serial_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ lazy_static = "1.2"
parking_lot = ">= 0.10, < 0.12"
serial_test_derive = { version = "~0.5.1", path = "../serial_test_derive" }
fslock = {version = "0.2", optional = true}
document-features = "0.2"
document-features = {version = "0.2", optional=true}

[features]
default = []

## The file_locks feature unlocks the `file_serial` macro
file_locks = ["fslock"]

docsrs = ["document-features"]

# docs.rs-specific configuration
[package.metadata.docs.rs]
all-features = true
Expand Down
5 changes: 4 additions & 1 deletion serial_test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
//! ````
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
#![cfg_attr(
feature = "docsrs",
cfg_attr(doc, doc = ::document_features::document_features!())
)]

mod code_lock;
#[cfg(feature = "file_locks")]
Expand Down

0 comments on commit b981a9a

Please sign in to comment.