From 8ee87b4ed795d13710cbda42f292c3976562a5ff Mon Sep 17 00:00:00 2001 From: Michael Macias Date: Fri, 2 Aug 2024 11:04:11 -0500 Subject: [PATCH] fastq/io/reader: Relax trait bounds for getting the underlying reader --- noodles-fastq/src/io/reader.rs | 36 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/noodles-fastq/src/io/reader.rs b/noodles-fastq/src/io/reader.rs index ca64e850d..1a0cf8f5c 100644 --- a/noodles-fastq/src/io/reader.rs +++ b/noodles-fastq/src/io/reader.rs @@ -15,23 +15,7 @@ pub struct Reader { inner: R, } -impl Reader -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 Reader { /// Returns a reference to the underlying reader. /// /// # Examples @@ -73,6 +57,24 @@ where pub fn into_inner(self) -> R { self.inner } +} + +impl Reader +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. ///