Skip to content

Commit

Permalink
Fix not being able to compile with default features (#11)
Browse files Browse the repository at this point in the history
Currently, the `doc` function states in it's doc comments that it is
only available on feature "help," however this is not enforced by a
`cfg(feature="help")` attribute. This pull request fixes that, as well
as a missing feature attribute gating a `use help` in lib.rs
  • Loading branch information
Kyllingene authored Aug 26, 2024
2 parents 393f967 + 0839144 commit fffb5fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ use std::ops::Deref;
pub mod macros;

pub mod tag;
use help::DocParams;
use tag::Full;

mod error;
pub use error::ArgParseError;

#[cfg(feature = "help")]
mod help;
#[cfg(feature = "help")]
use help::DocParams;

mod types;
pub use types::{ArgResult, ArgumentType, DefaultedArgResult};
Expand Down
1 change: 1 addition & 0 deletions src/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ impl Full {
///
/// Only available on feature `help`.
#[must_use]
#[cfg(feature = "help")]
pub fn doc<S: ToString>(mut self, doc: S) -> Self {
let doc = doc.to_string();
if doc.is_empty() {
Expand Down

0 comments on commit fffb5fd

Please sign in to comment.