Skip to content

Commit

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

impl<R> Reader<R>
where
R: BufRead,
{
/// Creates a FASTQ reader.
///
/// # Examples
///
/// ```
/// use noodles_fastq as fastq;
/// let data = b"@r0\nATCG\n+\nNDLS\n";
/// let reader = fastq::io::Reader::new(&data[..]);
/// ```
pub fn new(inner: R) -> Self {
Self { inner }
}

impl<R> Reader<R> {
/// Returns a reference to the underlying reader.
///
/// # Examples
Expand Down Expand Up @@ -73,6 +57,24 @@ where
pub fn into_inner(self) -> R {
self.inner
}
}

impl<R> Reader<R>
where
R: BufRead,
{
/// Creates a FASTQ reader.
///
/// # Examples
///
/// ```
/// use noodles_fastq as fastq;
/// let data = b"@r0\nATCG\n+\nNDLS\n";
/// let reader = fastq::io::Reader::new(&data[..]);
/// ```
pub fn new(inner: R) -> Self {
Self { inner }
}

/// Reads a FASTQ record.
///
Expand Down

0 comments on commit 8ee87b4

Please sign in to comment.