Skip to content

Commit 141e01c

Browse files
committed
fix: clippy and fmt after merging PR #466 and #467
1 parent 108bd42 commit 141e01c

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Diff for: src/bam/record.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -408,7 +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
411+
data[i + j / 2] = (ENCODE_BASE[seq[j] as usize] << 4)
412412
| (if j + 1 < seq.len() {
413413
ENCODE_BASE[seq[j + 1] as usize]
414414
} else {
@@ -1689,14 +1689,14 @@ impl Cigar {
16891689
fn encode(self) -> u32 {
16901690
match self {
16911691
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,
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,
17001700
}
17011701
}
17021702

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)