Skip to content

Commit

Permalink
Remove docsrs attributes from types and traits in walk.
Browse files Browse the repository at this point in the history
This change removes `docsrs` attributes from types and traits beneath
the `walk` module, only annotating the module itself and APIs presented
outside of the module (e.g., `Glob::walk`).
  • Loading branch information
olson-sean-k committed Nov 9, 2023
1 parent ed2f3d9 commit f3df644
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
4 changes: 0 additions & 4 deletions src/walk/glob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ impl<'t> Glob<'t> {
}
}

#[cfg_attr(docsrs, doc(cfg(feature = "walk")))]
pub trait IntoAnchor {
fn into_anchor(self, glob: &Glob<'_>) -> Anchor;
}
Expand All @@ -299,7 +298,6 @@ where
}
}

#[cfg_attr(docsrs, doc(cfg(feature = "walk")))]
#[derive(Clone, Debug, Hash, PartialEq)]
pub struct Anchor {
root: PathBuf,
Expand Down Expand Up @@ -333,7 +331,6 @@ impl Anchor {
/// [`Pattern`]: crate::Pattern
/// [`Pattern::is_exhaustive`]: crate::Pattern::is_exhaustive
/// [`WalkEntry`]: crate::WalkEntry
#[cfg_attr(docsrs, doc(cfg(feature = "walk")))]
#[derive(Clone, Debug)]
pub struct FilterAny {
exhaustive: Regex,
Expand Down Expand Up @@ -406,7 +403,6 @@ impl FilterAny {
/// Describes a file matching a [`Glob`] in a directory tree.
///
/// [`Glob`]: crate::Glob
#[cfg_attr(docsrs, doc(cfg(feature = "walk")))]
#[derive(Clone, Debug)]
pub struct GlobEntry {
entry: TreeEntry,
Expand Down
8 changes: 1 addition & 7 deletions src/walk/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg(feature = "walk")]

// TODO: Are `doc(cfg(feature = "walk"))` attributes redundant on items defined within this module?
#![cfg_attr(docsrs, doc(cfg(feature = "walk")))]

mod filter;
mod glob;
Expand Down Expand Up @@ -157,7 +156,6 @@ impl PathExt for Path {
/// are ignored.**
///
/// [`Glob::walk`]: crate::Glob::walk
#[cfg_attr(docsrs, doc(cfg(feature = "walk")))]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum LinkBehavior {
/// Read the symbolic link file itself.
Expand Down Expand Up @@ -210,7 +208,6 @@ pub enum LinkBehavior {
///
/// [`Glob`]: crate::Glob
/// [`Glob::walk`]: crate::Glob::walk
#[cfg_attr(docsrs, doc(cfg(feature = "walk")))]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct WalkBehavior {
// TODO: Consider using a dedicated type for this field. Using primitive types does not
Expand Down Expand Up @@ -422,7 +419,6 @@ impl SeparatingFilterInput for WalkTree {
/// [`Glob`]: crate::Glob
/// [`Iterator`]: std::iter::Iterator
/// [`WalkEntry`]: crate::WalkEntry
#[cfg_attr(docsrs, doc(cfg(feature = "walk")))]
pub trait FileIterator:
HierarchicalIterator<Feed = FileFeed<Self::Entry>> + Iterator<Item = FileFiltrate<Self::Entry>>
{
Expand Down Expand Up @@ -582,7 +578,6 @@ where
///
/// [`FileIterator::filter_tree`]: crate::FileIterator::filter_tree
/// [`WalkEntry`]: crate::WalkEntry
#[cfg_attr(docsrs, doc(cfg(feature = "walk")))]
#[derive(Clone, Debug)]
pub struct FilterEntry<I, F> {
input: I,
Expand Down Expand Up @@ -638,7 +633,6 @@ where

// TODO: Implement this using combinators provided by the `filter` module and RPITIT once it lands
// in stable Rust. Remove any use of `WalkCancellation::unchecked`.
#[cfg_attr(docsrs, doc(cfg(feature = "walk")))]
#[derive(Clone, Debug)]
pub struct Not<I> {
input: I,
Expand Down

0 comments on commit f3df644

Please sign in to comment.