Skip to content

Commit

Permalink
fastq/async/io/writer: Relax trait bounds for getting the underlying …
Browse files Browse the repository at this point in the history
…writer
  • Loading branch information
zaeleus committed Aug 2, 2024
1 parent 5c74722 commit e6735c5
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions noodles-fastq/src/async/io/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,7 @@ pub struct Writer<W> {
inner: W,
}

impl<W> Writer<W>
where
W: AsyncWrite + Unpin,
{
/// Creates an async FASTQ writer.
///
/// # Examples
///
/// ```
/// use noodles_fastq as fastq;
/// use tokio::io;
/// let writer = fastq::r#async::io::Writer::new(io::sink());
/// ```
pub fn new(inner: W) -> Self {
Self { inner }
}

impl<W> Writer<W> {
/// Returns a reference to the underlying writer.
///
/// # Examples
Expand Down Expand Up @@ -65,6 +49,24 @@ where
pub fn into_inner(self) -> W {
self.inner
}
}

impl<W> Writer<W>
where
W: AsyncWrite + Unpin,
{
/// Creates an async FASTQ writer.
///
/// # Examples
///
/// ```
/// use noodles_fastq as fastq;
/// use tokio::io;
/// let writer = fastq::r#async::io::Writer::new(io::sink());
/// ```
pub fn new(inner: W) -> Self {
Self { inner }
}

/// Writes a FASTQ record.
///
Expand Down

0 comments on commit e6735c5

Please sign in to comment.