Skip to content

Commit

Permalink
Bump Rust to 1.58.1 in CI and clippy cleanups (#55)
Browse files Browse the repository at this point in the history
* update Rust to 1.58.1
* clippy cleanup
* Rename BGW and use slices instead of Vec
* Make Rust installation closer to 10x repos
* reorganize parse_spec to use iterator adapters with collect
* use next_tuple for header parsing

Co-authored-by: Adam Azarchs <adam.azarchs@10xgenomics.com>
  • Loading branch information
luiz10x and adam-azarchs authored Jan 31, 2022
1 parent 69c3d9a commit 88c3ce5
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 113 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ jobs:
steps:
- name: Checkout git repository
uses: actions/checkout@master
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.58.1
default: true
- name: Make release build
run: |
cargo build --release
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ jobs:
# This job runs on MacOS Catalina
runs-on: macos-latest
steps:
- name: rust version
run: rustup default 1.44.0
- name: add rustfmt
run: rustup component add rustfmt
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.58.1
components: rustfmt
default: true
- name: Checkout bamtofastq master
uses: actions/checkout@master
- name: Check Rust formatting
Expand All @@ -31,10 +33,12 @@ jobs:
# This job runs on Linux
runs-on: ubuntu-latest
steps:
- name: rust version
run: rustup default 1.55.0
- name: add rustfmt
run: rustup component add rustfmt clippy
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.58.1
components: rustfmt, clippy
default: true
- name: Checkout bamtofastq master
uses: actions/checkout@master
- name: Check Rust formatting
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bamtofastq"
version = "1.4.0"
version = "1.4.1"
authors = ["Patrick Marks <patrick@10xgenomics.com>"]
license = "MIT"
repository = "https://github.com/10XGenomics/bamtofastq.git"
Expand Down
11 changes: 5 additions & 6 deletions src/bx_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl BxIndex {
pub fn get_records_for_bx<R: Read>(
index: &BxIndex,
reader: &mut R,
bx: &String,
bx: &str,
) -> Result<Vec<Record>, Error> {
let start = index.get_voffset(bx);
reader.seek(start as i64)?;
Expand All @@ -78,9 +78,9 @@ pub fn get_records_for_bx<R: Read>(
_ => "".to_string(),
};

if &bx_read == bx {
if bx_read == bx {
recs.push(rec);
} else if &bx_read < bx {
} else if bx_read.as_str() < bx {
continue;
} else {
break;
Expand Down Expand Up @@ -150,9 +150,8 @@ impl<R: Read> Iterator for BxListIter<R> {
self.cur_vec.reverse();
}

match self.cur_vec.pop() {
Some(v) => return Some(Ok(v)),
None => (),
if let Some(v) = self.cur_vec.pop() {
return Some(Ok(v));
}
}

Expand Down
Loading

0 comments on commit 88c3ce5

Please sign in to comment.