Skip to content

Commit

Permalink
Fix doctests compiling on Windows (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
vallentin authored Jul 16, 2024
1 parent ff0ce2a commit 206d253
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions dotenv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,14 @@ pub fn from_filename_iter<P: AsRef<Path>>(filename: P) -> Result<Iter<File>> {
/// # Examples
///
/// ```no_run
/// # #![cfg(unix)]
/// use std::io::Read;
/// # #[cfg(unix)]
/// use std::os::unix::net::UnixStream;
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// # #[cfg(unix)]
/// let mut stream = UnixStream::connect("/some/socket")?;
/// # #[cfg(unix)]
/// dotenvy::from_read(stream)?;
/// # Ok(())
/// # }
Expand All @@ -267,12 +269,14 @@ pub fn from_read<R: io::Read>(reader: R) -> Result<()> {
///
/// # Examples
/// ```no_run
/// # #![cfg(unix)]
/// use std::io::Read;
/// # #[cfg(unix)]
/// use std::os::unix::net::UnixStream;
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// # #[cfg(unix)]
/// let mut stream = UnixStream::connect("/some/socket")?;
/// # #[cfg(unix)]
/// dotenvy::from_read_override(stream)?;
/// # Ok(())
/// # }
Expand All @@ -288,13 +292,15 @@ pub fn from_read_override<R: io::Read>(reader: R) -> Result<()> {
/// # Examples
///
/// ```no_run
/// # #![cfg(unix)]
/// use std::io::Read;
/// # #[cfg(unix)]
/// use std::os::unix::net::UnixStream;
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// # #[cfg(unix)]
/// let mut stream = UnixStream::connect("/some/socket")?;
///
/// # #[cfg(unix)]
/// for item in dotenvy::from_read_iter(stream) {
/// let (key, val) = item?;
/// println!("{}={}", key, val);
Expand Down

0 comments on commit 206d253

Please sign in to comment.