Skip to content

Commit

Permalink
fixup BSD doc tests
Browse files Browse the repository at this point in the history
for some reason the current folder "." can't be found on BSD
  • Loading branch information
0xpr03 committed Aug 8, 2023
1 parent 86707e9 commit f3ea8c9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions notify/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
//!
//! For more examples visit the [examples folder](https://github.com/notify-rs/notify/tree/main/examples) in the repository.
//!
//! ```rust,no_exec
//! ```rust
//! # use std::path::Path;
//! use notify::{Watcher, RecommendedWatcher, RecursiveMode, Result};
//!
Expand All @@ -103,7 +103,14 @@
//!
//! // Add a path to be watched. All files and directories at that path and
//! // below will be monitored for changes.
//! # #[cfg(not(any(
//! # target_os = "freebsd",
//! # target_os = "openbsd",
//! # target_os = "dragonflybsd",
//! # target_os = "netbsd")))]
//! # { // "." doesn't exist on BSD for some reason in CI
//! watcher.watch(Path::new("."), RecursiveMode::Recursive)?;
//! # }
//!
//! Ok(())
//! }
Expand All @@ -114,7 +121,7 @@
//! It is possible to create several watchers with different configurations or implementations that
//! all call the same event function. This can accommodate advanced behaviour or work around limits.
//!
//! ```
//! ```rust
//! # use notify::{RecommendedWatcher, RecursiveMode, Result, Watcher};
//! # use std::path::Path;
//! #
Expand All @@ -129,8 +136,16 @@
//! let mut watcher1 = notify::recommended_watcher(event_fn)?;
//! // we will just use the same watcher kind again here
//! let mut watcher2 = notify::recommended_watcher(event_fn)?;
//! # #[cfg(not(any(
//! # target_os = "freebsd",
//! # target_os = "openbsd",
//! # target_os = "dragonflybsd",
//! # target_os = "netbsd")))]
//! # { // "." doesn't exist on BSD for some reason in CI
//! # watcher1.watch(Path::new("."), RecursiveMode::Recursive)?;
//! # watcher2.watch(Path::new("."), RecursiveMode::Recursive)?;
//! # }
//! // dropping the watcher1/2 here (no loop etc) will end the program
//! #
//! # Ok(())
//! # }
Expand Down

0 comments on commit f3ea8c9

Please sign in to comment.