|
1 | 1 | // Copyright (c) 2019 10x Genomics, Inc. All rights reserved.
|
2 | 2 |
|
| 3 | +use anyhow::{format_err, Error}; |
| 4 | +use rust_htslib::bam; |
| 5 | +use rust_htslib::bam::header::{Header, HeaderRecord}; |
| 6 | +use rust_htslib::bam::HeaderView; |
| 7 | +use star_sys::{self as bindings, Aligner as BindAligner, StarRef as BindRef}; |
3 | 8 | use std::ffi::{CStr, CString};
|
4 | 9 | use std::fs::File;
|
5 | 10 | use std::io::prelude::*;
|
6 | 11 | use std::io::BufReader;
|
7 |
| -use std::os::raw::c_char; |
8 |
| -use std::os::raw::c_int; |
| 12 | +use std::os::raw::{c_char, c_int}; |
9 | 13 | use std::path::Path;
|
10 | 14 | use std::sync::Arc;
|
11 | 15 |
|
12 |
| -use anyhow::{format_err, Error}; |
13 |
| -use rust_htslib::bam; |
14 |
| -use rust_htslib::bam::header::{Header, HeaderRecord}; |
15 |
| -use rust_htslib::bam::HeaderView; |
16 |
| -use star_sys::{self as bindings, Aligner as BindAligner, StarRef as BindRef}; |
17 |
| - |
18 | 16 | pub struct StarReference {
|
19 | 17 | inner: Arc<InnerStarReference>,
|
20 | 18 | }
|
@@ -141,8 +139,8 @@ impl StarSettings {
|
141 | 139 | let refpath = Path::new(&self.reference_path);
|
142 | 140 | ["Genome", "SA", "SAindex"]
|
143 | 141 | .iter()
|
144 |
| - .fold(Ok(0usize), |acc, file| { |
145 |
| - Ok(acc? + std::fs::metadata(refpath.join(file))?.len() as usize) |
| 142 | + .try_fold(0usize, |acc, file| { |
| 143 | + Ok(acc + std::fs::metadata(refpath.join(file))?.len() as usize) |
146 | 144 | })
|
147 | 145 | }
|
148 | 146 | }
|
|
0 commit comments