Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 5ce96ff

Browse files
authored
Update rust to 1.65 (#210)
Fix new clippy lints. Update to maintained github actions.
1 parent 446e166 commit 5ce96ff

File tree

9 files changed

+22
-23
lines changed

9 files changed

+22
-23
lines changed

.github/workflows/test.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,39 @@ jobs:
1515
rust:
1616
runs-on: ubuntu-20.04
1717
steps:
18-
- uses: actions-rs/toolchain@v1
18+
- uses: dtolnay/rust-toolchain@master
1919
with:
20-
toolchain: 1.63.0
20+
toolchain: 1.65.0
2121
components: rustfmt, clippy
22-
default: true
2322
- name: Checkout git repository
2423
uses: actions/checkout@master
2524
- name: Check Rust formatting
2625
run: cargo fmt -- --check
2726
- name: Install cargo-deny
2827
run: |
29-
wget https://github.com/EmbarkStudios/cargo-deny/releases/download/0.12.2/cargo-deny-0.12.2-x86_64-unknown-linux-musl.tar.gz
30-
tar -xvf cargo-deny-0.12.2-x86_64-unknown-linux-musl.tar.gz
28+
wget https://github.com/EmbarkStudios/cargo-deny/releases/download/0.13.5/cargo-deny-0.13.5-x86_64-unknown-linux-musl.tar.gz
29+
tar -xvf cargo-deny-0.13.5-x86_64-unknown-linux-musl.tar.gz
3130
mkdir -p ~/bin/
32-
cp cargo-deny-0.12.2-x86_64-unknown-linux-musl/cargo-deny ~/bin/
31+
cp cargo-deny-0.13.5-x86_64-unknown-linux-musl/cargo-deny ~/bin/
3332
rm -r cargo-deny-*
3433
echo "$HOME/bin" >> $GITHUB_PATH
3534
- name: Cache cargo registry
3635
uses: actions/cache@v3
3736
with:
3837
path: ~/.cargo/registry
39-
key: ${{runner.os}}-cargo-registry-${{hashFiles('**/*.rs')}}
38+
key: ${{runner.os}}-cargo-registry-${{hashFiles('Cargo.lock')}}
4039
restore-keys: ${{runner.os}}-cargo-registry-
4140
- name: Cache cargo git index
4241
uses: actions/cache@v3
4342
with:
4443
path: ~/.cargo/git
45-
key: ${{runner.os}}-cargo-git-${{hashFiles('**/*.rs')}}
44+
key: ${{runner.os}}-cargo-git-${{hashFiles('Cargo.lock')}}
4645
restore-keys: ${{runner.os}}-cargo-git-
4746
- name: Cache cargo build --release --all-targets
4847
uses: actions/cache@v3
4948
with:
5049
path: target
51-
key: ${{runner.os}}-cargo-target-${{hashFiles('**/*.rs')}}
50+
key: ${{runner.os}}-cargo-target-${{hashFiles('Cargo.lock')}}-${{hashFiles('**/Cargo.toml')}}
5251
restore-keys: |
5352
${{runner.os}}-cargo-target-
5453
- name: Remove the Cargo target directory

fasta_tools/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub fn read_fasta_to_vec_vec_u8(f: impl AsRef<Path>) -> Vec<Vec<u8>> {
3939
x.push(last.as_bytes().to_vec());
4040
}
4141
_ => {
42-
let gz = MultiGzDecoder::new(std::fs::File::open(&f).unwrap());
42+
let gz = MultiGzDecoder::new(std::fs::File::open(f).unwrap());
4343
let fin = std::io::BufReader::new(gz);
4444
let mut last: String = String::new();
4545
let mut first = true;
@@ -99,7 +99,7 @@ pub fn read_fasta_into_vec_dna_string_plus_headers(
9999
dv.push(DnaString::from_dna_string(&last));
100100
}
101101
_ => {
102-
let gz = MultiGzDecoder::new(std::fs::File::open(&f).unwrap());
102+
let gz = MultiGzDecoder::new(std::fs::File::open(f).unwrap());
103103
let fin = std::io::BufReader::new(gz);
104104
let mut last: String = String::new();
105105
let mut first = true;

io_utils/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use string_utils::TextUtils;
1616
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
1717

1818
pub fn dir_list(d: &str) -> Vec<String> {
19-
let x = fs::read_dir(&d).unwrap_or_else(|_| panic!("failed to read directory {}", d));
19+
let x = fs::read_dir(d).unwrap_or_else(|_| panic!("failed to read directory {}", d));
2020
let mut y = Vec::<String>::new();
2121
for f in x {
2222
let s: String = f.unwrap().file_name().into_string().unwrap();

mirror_sparse_matrix/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ pub struct MirrorSparseMatrix {
6565

6666
pub fn get_code_version_from_file(f: &str) -> u32 {
6767
assert_eq!(std::mem::size_of::<usize>(), 8); // for the usize at the beginning of the file
68-
let mut ff = std::fs::File::open(&f).unwrap();
68+
let mut ff = std::fs::File::open(f).unwrap();
6969
let mut x = vec![0_u32; 11];
7070
binary_read_to_ref::<u32>(&mut ff, &mut x[0], 11).unwrap();
7171
x[10]
7272
}
7373

7474
pub fn read_from_file(s: &mut MirrorSparseMatrix, f: &str) {
75-
let mut ff = std::fs::File::open(&f).unwrap();
75+
let mut ff = std::fs::File::open(f).unwrap();
7676
binary_read_vec::<u8>(&mut ff, &mut s.x).unwrap();
7777
if s.code_version() != 0 && s.code_version() != 1 {
7878
panic!(
@@ -91,7 +91,7 @@ pub fn read_from_file(s: &mut MirrorSparseMatrix, f: &str) {
9191
pub fn write_to_file(s: &MirrorSparseMatrix, f: &str) {
9292
assert!(s.code_version() > 0);
9393
let mut ff =
94-
std::fs::File::create(&f).unwrap_or_else(|_| panic!("Failed to create file {}.", f));
94+
std::fs::File::create(f).unwrap_or_else(|_| panic!("Failed to create file {}.", f));
9595
binary_write_vec::<u8>(&mut ff, &s.x).unwrap();
9696
}
9797

pretty_trace/examples/bad_traceback.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ use std::fs;
1313
fn main() {
1414
PrettyTrace::new().on();
1515
let not = "file_that_does_not_exist";
16-
let _ = fs::read_to_string(&not).unwrap();
16+
let _ = fs::read_to_string(not).unwrap();
1717
}

pretty_trace/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ fn force_pretty_trace_fancy(
946946
█ a string. This is weird and might result in a defective traceback.\n\n";
947947
}
948948
Some(ex) => {
949-
let f = File::open(&ex);
949+
let f = File::open(ex);
950950
if f.is_err() {
951951
out +=
952952
"█ WARNING. Your executable file could not be opened for reading.\n\
@@ -1249,7 +1249,7 @@ fn prettify_traceback(bt: &[u8], whitelist: &[String], pack: bool) -> String {
12491249
// Don't allow blocklets whose first line has the form ... main(...).
12501250

12511251
let m = " main (";
1252-
if s.contains(&m) && s.after(m).contains(')') && !s.between(m, ")").contains('(') {
1252+
if s.contains(m) && s.after(m).contains(')') && !s.between(m, ")").contains('(') {
12531253
to_delete[j] = true;
12541254
}
12551255
}

vdj_ann/src/annotate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2916,7 +2916,7 @@ impl AnnotationUnit {
29162916
let types = vec!["IGH", "IGK", "IGL", "TRA", "TRB", "TRD", "TRG"];
29172917
let mut chain_type = String::new();
29182918
for i in 0..types.len() {
2919-
if refdata.rheaders[t].contains(&types[i]) {
2919+
if refdata.rheaders[t].contains(types[i]) {
29202920
chain_type = types[i].to_string();
29212921
break;
29222922
}

vdj_ann_ref/src/bin/build_vdj_ref.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -991,13 +991,13 @@ fn main() {
991991
.expect("gunzip failed");
992992
}
993993
Command::new("git")
994-
.current_dir(&internal)
994+
.current_dir(internal)
995995
.arg("add")
996996
.arg(&path)
997997
.status()
998998
.expect("git add failed");
999999
Command::new("git")
1000-
.current_dir(&internal)
1000+
.current_dir(internal)
10011001
.arg("commit")
10021002
.arg(path)
10031003
.status()

vdj_ann_ref/src/bin/build_vdj_ref_exons.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -628,13 +628,13 @@ fn main() {
628628
.expect("gunzip failed");
629629
}
630630
Command::new("git")
631-
.current_dir(&internal)
631+
.current_dir(internal)
632632
.arg("add")
633633
.arg(&path)
634634
.status()
635635
.expect("git add failed");
636636
Command::new("git")
637-
.current_dir(&internal)
637+
.current_dir(internal)
638638
.arg("commit")
639639
.arg(path)
640640
.status()

0 commit comments

Comments
 (0)