Skip to content

Commit 2a73c42

Browse files
committed
style(clippy): fix
1 parent d6f5621 commit 2a73c42

3 files changed

Lines changed: 31 additions & 31 deletions

File tree

src/record/sequencing_record.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,15 @@ impl<'a> SequencingRecord<'a> {
161161
/// extra data in the record that the writer won't use.
162162
///
163163
/// The VBQ record layout is:
164-
/// - Flag (8 bytes, if has_flags)
165-
/// - s_len (8 bytes)
166-
/// - x_len (8 bytes)
167-
/// - s_seq (encoded, rounded up to 8-byte words)
168-
/// - s_qual (raw bytes, if has_qualities)
169-
/// - s_header_len + s_header (8 + len bytes, if has_headers and s_header present)
170-
/// - x_seq (encoded, rounded up to 8-byte words, if paired)
171-
/// - x_qual (raw bytes, if has_qualities and paired)
172-
/// - x_header_len + x_header (8 + len bytes, if has_headers and x_header present)
164+
/// - Flag (8 bytes, if `has_flags`)
165+
/// - `s_len` (8 bytes)
166+
/// - `x_len` (8 bytes)
167+
/// - `s_seq` (encoded, rounded up to 8-byte words)
168+
/// - `s_qual` (raw bytes, if `has_qualities`)
169+
/// - `s_header_len` + `s_header` (8 + len bytes, if `has_headers` and `s_header` present)
170+
/// - `x_seq` (encoded, rounded up to 8-byte words, if paired)
171+
/// - `x_qual` (raw bytes, if `has_qualities` and paired)
172+
/// - `x_header_len` + `x_header` (8 + len bytes, if `has_headers` and `x_header` present)
173173
#[inline]
174174
#[must_use]
175175
pub fn configured_size_vbq(
@@ -222,10 +222,8 @@ impl<'a> SequencingRecord<'a> {
222222
if let Some(h) = self.s_header {
223223
size += 8 + h.len(); // length prefix + header bytes
224224
}
225-
if is_paired {
226-
if let Some(h) = self.x_header {
227-
size += 8 + h.len(); // length prefix + header bytes
228-
}
225+
if is_paired && let Some(h) = self.x_header {
226+
size += 8 + h.len(); // length prefix + header bytes
229227
}
230228
}
231229

src/utils/fastx.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ impl FastxEncoderBuilder {
104104
/// .run()?;
105105
/// # Ok::<(), binseq::Error>(())
106106
/// ```
107+
#[must_use]
107108
pub fn input_stdin(mut self) -> Self {
108109
self.input = Some(FastxInput::Stdin);
109110
self
@@ -150,6 +151,7 @@ impl FastxEncoderBuilder {
150151
/// .run()?;
151152
/// # Ok::<(), binseq::Error>(())
152153
/// ```
154+
#[must_use]
153155
pub fn threads(mut self, n: usize) -> Self {
154156
self.threads = n;
155157
self

src/vbq/writer.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -897,18 +897,18 @@ impl BlockWriter {
897897
self.write_buffer(sbuf)?;
898898

899899
// Write primary quality (only if configured)
900-
if self.has_qualities {
901-
if let Some(qual) = record.s_qual {
902-
self.write_u8buf(qual)?;
903-
}
900+
if self.has_qualities
901+
&& let Some(qual) = record.s_qual
902+
{
903+
self.write_u8buf(qual)?;
904904
}
905905

906906
// Write primary header (only if configured)
907-
if self.has_headers {
908-
if let Some(sheader) = record.s_header {
909-
self.write_length(sheader.len() as u64)?;
910-
self.write_u8buf(sheader)?;
911-
}
907+
if self.has_headers
908+
&& let Some(sheader) = record.s_header
909+
{
910+
self.write_length(sheader.len() as u64)?;
911+
self.write_u8buf(sheader)?;
912912
}
913913

914914
// Write the optional extended sequence
@@ -917,18 +917,18 @@ impl BlockWriter {
917917
}
918918

919919
// Write extended quality (only if configured)
920-
if self.has_qualities {
921-
if let Some(qual) = record.x_qual {
922-
self.write_u8buf(qual)?;
923-
}
920+
if self.has_qualities
921+
&& let Some(qual) = record.x_qual
922+
{
923+
self.write_u8buf(qual)?;
924924
}
925925

926926
// Write extended header (only if configured)
927-
if self.has_headers {
928-
if let Some(xheader) = record.x_header {
929-
self.write_length(xheader.len() as u64)?;
930-
self.write_u8buf(xheader)?;
931-
}
927+
if self.has_headers
928+
&& let Some(xheader) = record.x_header
929+
{
930+
self.write_length(xheader.len() as u64)?;
931+
self.write_u8buf(xheader)?;
932932
}
933933

934934
Ok(())

0 commit comments

Comments
 (0)