Skip to content

Commit d44bf5c

Browse files
committed
Clippy fixes
1 parent 108bd42 commit d44bf5c

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Diff for: src/bam/record.rs

+9-10
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,7 @@ impl Record {
408408
// seq
409409
{
410410
for j in (0..seq.len()).step_by(2) {
411-
data[i + j / 2] = ENCODE_BASE[seq[j] as usize] << 4
412-
| (if j + 1 < seq.len() {
411+
data[i + j / 2] = (ENCODE_BASE[seq[j] as usize] << 4) | (if j + 1 < seq.len() {
413412
ENCODE_BASE[seq[j + 1] as usize]
414413
} else {
415414
0
@@ -1689,14 +1688,14 @@ impl Cigar {
16891688
fn encode(self) -> u32 {
16901689
match self {
16911690
Cigar::Match(len) => len << 4, // | 0,
1692-
Cigar::Ins(len) => len << 4 | 1,
1693-
Cigar::Del(len) => len << 4 | 2,
1694-
Cigar::RefSkip(len) => len << 4 | 3,
1695-
Cigar::SoftClip(len) => len << 4 | 4,
1696-
Cigar::HardClip(len) => len << 4 | 5,
1697-
Cigar::Pad(len) => len << 4 | 6,
1698-
Cigar::Equal(len) => len << 4 | 7,
1699-
Cigar::Diff(len) => len << 4 | 8,
1691+
Cigar::Ins(len) => (len << 4) | 1,
1692+
Cigar::Del(len) => (len << 4) | 2,
1693+
Cigar::RefSkip(len) => (len << 4) | 3,
1694+
Cigar::SoftClip(len) => (len << 4) | 4,
1695+
Cigar::HardClip(len) => (len << 4) | 5,
1696+
Cigar::Pad(len) => (len << 4) | 6,
1697+
Cigar::Equal(len) => (len << 4) | 7,
1698+
Cigar::Diff(len) => (len << 4) | 8,
17001699
}
17011700
}
17021701

Diff for: src/bcf/header.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ impl HeaderView {
375375
let n = (*self.inner).n[htslib::BCF_DT_ID as usize] as usize;
376376
let entry = slice::from_raw_parts((*self.inner).id[htslib::BCF_DT_ID as usize], n);
377377
let d = (*entry[id as usize].val).info[hdr_type as usize];
378-
(d >> 4 & 0xf, d >> 8 & 0xf, d >> 12)
378+
((d >> 4) & 0xf, (d >> 8) & 0xf, d >> 12)
379379
};
380380
let _type = match _type as ::libc::c_uint {
381381
htslib::BCF_HT_FLAG => TagType::Flag,

Diff for: src/bcf/record.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ impl From<GenotypeAllele> for i32 {
12021202
GenotypeAllele::Unphased(a) => (a, 0),
12031203
GenotypeAllele::Phased(a) => (a, 1),
12041204
};
1205-
(allele + 1) << 1 | phased
1205+
((allele + 1) << 1) | phased
12061206
}
12071207
}
12081208

0 commit comments

Comments
 (0)