Skip to content

Commit 7346290

Browse files
committed
chore: prevent warnings from test-only functions and traits
1 parent 87f8d89 commit 7346290

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/stream.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ pin_project! {
566566
///
567567
/// The returned future will resolve to both the I/O stream and the buffer
568568
/// as well as the number of bytes read once the read operation is completed.
569+
#[cfg(test)]
569570
fn read<'a, R>(reader: &'a mut R, buf: &'a mut [u8]) -> ReadFut<'a, R>
570571
where
571572
R: Read + Unpin + ?Sized,
@@ -587,6 +588,7 @@ where
587588
}
588589
}
589590

591+
#[cfg(test)]
590592
trait ReadExt: Read {
591593
/// Pulls some bytes from this source into the specified buffer,
592594
/// returning how many bytes were read.
@@ -608,6 +610,7 @@ pin_project! {
608610

609611
/// Tries to write some bytes from the given `buf` to the writer in an
610612
/// asynchronous manner, returning a future.
613+
#[cfg(test)]
611614
fn write<'a, W>(writer: &'a mut W, buf: &'a [u8]) -> WriteFut<'a, W>
612615
where
613616
W: Write + Unpin + ?Sized,
@@ -627,6 +630,7 @@ where
627630
}
628631
}
629632

633+
#[cfg(test)]
630634
trait WriteExt: Write {
631635
/// Writes a buffer into this writer, returning how many bytes were
632636
/// written.
@@ -638,6 +642,7 @@ trait WriteExt: Write {
638642
}
639643
}
640644

645+
#[cfg(test)]
641646
impl<R> ReadExt for Pin<&mut TimeoutReader<R>>
642647
where
643648
R: Read,
@@ -647,6 +652,7 @@ where
647652
}
648653
}
649654

655+
#[cfg(test)]
650656
impl<W> WriteExt for Pin<&mut TimeoutWriter<W>>
651657
where
652658
W: Write,
@@ -656,6 +662,7 @@ where
656662
}
657663
}
658664

665+
#[cfg(test)]
659666
impl<S> ReadExt for Pin<&mut TimeoutStream<S>>
660667
where
661668
S: Read + Write,
@@ -665,6 +672,7 @@ where
665672
}
666673
}
667674

675+
#[cfg(test)]
668676
impl<S> WriteExt for Pin<&mut TimeoutStream<S>>
669677
where
670678
S: Read + Write,

0 commit comments

Comments
 (0)