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

Commit f81f772

Browse files
committed
Update CI version of rust.
Run cargo clippy --fix.
1 parent 45fe922 commit f81f772

File tree

10 files changed

+22
-22
lines changed

10 files changed

+22
-22
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- uses: actions-rs/toolchain@v1
1919
with:
20-
toolchain: 1.58.1
20+
toolchain: 1.59.0
2121
components: rustfmt, clippy
2222
default: true
2323
- name: Checkout git repository

ansi_escape/src/ansi_to_html.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub fn compress_ansi_escapes(x: &str) -> String {
238238
for e in escapes.iter() {
239239
if e.solo() && e[0] == 1 {
240240
if reset || new_state.bold != old_state.bold {
241-
out += &strme(&pack_ansi_escape(e)).to_string();
241+
out += strme(&pack_ansi_escape(e));
242242
}
243243
break;
244244
}
@@ -249,7 +249,7 @@ pub fn compress_ansi_escapes(x: &str) -> String {
249249
|| (y.len() == 3 && y[0] == 38 && y[1] == 5)
250250
{
251251
if reset || new_state.color != old_state.color {
252-
out += &strme(&pack_ansi_escape(y)).to_string();
252+
out += strme(&pack_ansi_escape(y));
253253
}
254254
break;
255255
}
@@ -260,7 +260,7 @@ pub fn compress_ansi_escapes(x: &str) -> String {
260260
|| (y.len() == 3 && y[0] == 48 && y[1] == 5)
261261
{
262262
if reset || new_state.background != old_state.background {
263-
out += &strme(&pack_ansi_escape(y)).to_string();
263+
out += strme(&pack_ansi_escape(y));
264264
}
265265
break;
266266
}
@@ -404,7 +404,7 @@ impl ColorState {
404404
s += &format!("background-color:{};", self.background);
405405
}
406406
if self.bold {
407-
s += &"font-weight:bold;".to_string()
407+
s += "font-weight:bold;"
408408
}
409409
s += "\">";
410410
s
@@ -422,7 +422,7 @@ impl ColorState {
422422
s += &format!("fill: {};", self.color);
423423
}
424424
if self.bold {
425-
s += &"font-weight: bold;".to_string()
425+
s += "font-weight: bold;"
426426
}
427427
s += "\">";
428428
s

fasta_tools/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,6 @@ pub fn load_genbank_accession(accession: &str, bases: &mut DnaString) {
195195
// ◼ The following assert should not be necessary: the DnaString constructor
196196
// ◼ should gag if it gets nonsense input.
197197
assert!(!fasta.contains("moved"));
198-
fasta = fasta.replace("\n", "");
198+
fasta = fasta.replace('\n', "");
199199
*bases = DnaString::from_dna_string(&fasta);
200200
}

perf_stats/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ pub fn nthreads() -> i64 {
4040
let s = line.unwrap();
4141
if s.starts_with("Threads:") {
4242
let mut s = s.after("Threads:").to_string();
43-
s = s.replace("\t", "");
44-
s = s.replace(" ", "");
43+
s = s.replace('\t', "");
44+
s = s.replace(' ', "");
4545
return s.force_i64();
4646
}
4747
}
@@ -229,7 +229,7 @@ pub fn ps_me() {
229229
ppid = s.after("PPid:\t").force_i64();
230230
} else if s.starts_with("VmRSS:\t") {
231231
let t = s.after("VmRSS:\t");
232-
let t = t.to_string().replace(" ", "");
232+
let t = t.to_string().replace(' ', "");
233233
rss = t.before("k").force_f64() / (1024 * 1024) as f64;
234234
}
235235
}
@@ -245,7 +245,7 @@ pub fn ps_me() {
245245
continue 'outer;
246246
} // fail that does occur rarely
247247
cmd = line.unwrap();
248-
cmd = cmd.replace("
248+
cmd = cmd.replace('
249249
}
250250
if cmd.len() <= RIGHT {
251251
println!("{:6} {:6} {:7.2} {}", ppid, pid, rss, cmd);

pretty_trace/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ pub fn stop_profiling() {
306306
}
307307
if !symv.is_empty() {
308308
let mut log = String::new();
309-
print_tabular_vbox(&mut log, &symv, 0, &b"l|l|l|l|l".to_vec(), false, false);
309+
print_tabular_vbox(&mut log, &symv, 0, b"l|l|l|l|l".as_ref(), false, false);
310310
for _ in 0..*count {
311311
let x = log.to_string();
312312
traces.push(x);

vdj_ann/src/annotate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3344,7 +3344,7 @@ mod tests {
33443344
let annotation = ContigAnnotation::from_seq(
33453345
&contig_seq,
33463346
&contig_qual,
3347-
&"clonotype125_consensus_1".to_string(),
3347+
"clonotype125_consensus_1",
33483348
&refdata,
33493349
120,
33503350
2,

vdj_ann/src/vdj_features.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ pub fn score_fwr3(aa: &[u8], r: usize, freqs: &[Vec<Vec<(u32, u8)>>]) -> f64 {
679679
} else {
680680
chain_type = "TRB";
681681
}
682-
let cdr3 = cdr3_start(&aa.to_vec(), chain_type, false);
682+
let cdr3 = cdr3_start(aa, chain_type, false);
683683
let motif = freqs[0].len();
684684
let mut score = 0.0;
685685
for j in 0..motif {
@@ -736,7 +736,7 @@ pub fn score4(aa: &[u8], r: usize) -> usize {
736736
} else {
737737
chain_type = "TRB";
738738
}
739-
let cdr3 = cdr3_start(&aa.to_vec(), chain_type, false);
739+
let cdr3 = cdr3_start(aa, chain_type, false);
740740
let n = aa.len();
741741
assert!(n >= 22);
742742
let mut score = 0;

vdj_ann_ref/src/bin/build_supp_ref.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn main() {
6666
// Load the exons.
6767

6868
let mut exons = Vec::<(String, i32, i32, bool, String, i32)>::new();
69-
fetch_exons(&species.to_string(), &mut exons);
69+
fetch_exons(species, &mut exons);
7070

7171
// Hardcoded and inappropriate fasta location.
7272
// source = ftp://ftp.ensembl.org/pub/release-94/fasta/homo_sapiens/
@@ -168,10 +168,10 @@ fn main() {
168168
if i > 0 && *chr == exons2[i - 1].0 && gap < MIN_EXTRA as i32 {
169169
continue;
170170
}
171-
if !to_chr.contains_key(&chr.to_string()) {
171+
if !to_chr.contains_key(chr) {
172172
continue;
173173
}
174-
let chrid = to_chr[&chr.to_string()];
174+
let chrid = to_chr[chr];
175175

176176
// Case 1. Gap is not too long, use it all. Create sequence and emit as
177177
// rust code. Then code the rc.

vdj_ann_ref/src/bin/build_vdj_ref.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ fn main() {
11731173
if gene2.contains('(') {
11741174
gene2 = gene2.before("(").to_string();
11751175
}
1176-
gene2 = gene2.replace(" ", "");
1176+
gene2 = gene2.replace(' ', "");
11771177
if gene2.contains("identical") || gene2.contains("identicle") {
11781178
continue;
11791179
}
@@ -1260,7 +1260,7 @@ fn main() {
12601260
let mut dna = Vec::<DnaString>::new();
12611261
for i in 0..exons.len() {
12621262
let chr = &exons[i].2;
1263-
let chrid = to_chr[&chr.to_string()];
1263+
let chrid = to_chr[chr];
12641264
let (start, stop) = (exons[i].3, exons[i].4);
12651265
let seq = refs[chrid].slice(start as usize, stop as usize).to_owned();
12661266
dna.push(seq);

vdj_ann_ref/src/bin/build_vdj_ref_exons.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ fn main() {
824824
if gene2.contains('(') {
825825
gene2 = gene2.before("(").to_string();
826826
}
827-
gene2 = gene2.replace(" ", "");
827+
gene2 = gene2.replace(' ', "");
828828
if gene2.contains("identical") || gene2.contains("identicle") {
829829
continue;
830830
}
@@ -912,7 +912,7 @@ fn main() {
912912
let mut stops = Vec::<usize>::new();
913913
for i in 0..exons.len() {
914914
let chr = &exons[i].2;
915-
let chrid = to_chr[&chr.to_string()];
915+
let chrid = to_chr[chr];
916916
starts.push(exons[i].3 as usize);
917917
stops.push(exons[i].4 as usize);
918918
let (start, stop) = (exons[i].3 - EXT as i32, exons[i].4 + EXT as i32);

0 commit comments

Comments
 (0)