Skip to content

Commit 4b17b7e

Browse files
committed
Adjusting formatting to current stable.
1 parent 71cbf82 commit 4b17b7e

File tree

3 files changed

+36
-11
lines changed

3 files changed

+36
-11
lines changed

src/bam/record_serde.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ impl<'de> Deserialize<'de> for Record {
289289

290290
#[cfg(test)]
291291
mod tests {
292-
use bam::record::Record;
293292
use bam::Read;
294293
use bam::Reader;
294+
use bam::record::Record;
295295

296296
use std::path::Path;
297297

src/bcf/header.rs

+32-7
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,30 @@ impl Drop for Header {
197197
#[derive(Debug)]
198198
pub enum HeaderRecord {
199199
/// A `FILTER` header record.
200-
Filter { key: String, values: LinearMap<String, String> },
200+
Filter {
201+
key: String,
202+
values: LinearMap<String, String>,
203+
},
201204
/// An `INFO` header record.
202-
Info { key: String, values: LinearMap<String, String> },
205+
Info {
206+
key: String,
207+
values: LinearMap<String, String>,
208+
},
203209
/// A `FORMAT` header record.
204-
Format { key: String, values: LinearMap<String, String> },
210+
Format {
211+
key: String,
212+
values: LinearMap<String, String>,
213+
},
205214
/// A `contig` header record.
206-
Contig { key: String, values: LinearMap<String, String> },
215+
Contig {
216+
key: String,
217+
values: LinearMap<String, String>,
218+
},
207219
/// A structured header record.
208-
Structured { key: String, values: LinearMap<String, String> },
220+
Structured {
221+
key: String,
222+
values: LinearMap<String, String>,
223+
},
209224
/// A generic, unstructured header record.
210225
Generic { key: String, value: String },
211226
}
@@ -365,8 +380,18 @@ impl HeaderView {
365380
fn parse_kv(rec: &htslib::bcf_hrec_t) -> LinearMap<String, String> {
366381
let mut result: LinearMap<String, String> = LinearMap::new();
367382
for i in 0_i32..(rec.nkeys) {
368-
let key = unsafe { ffi::CStr::from_ptr(*rec.keys.offset(i as isize)).to_str().unwrap().to_string() };
369-
let value = unsafe { ffi::CStr::from_ptr(*rec.vals.offset(i as isize)).to_str().unwrap().to_string() };
383+
let key = unsafe {
384+
ffi::CStr::from_ptr(*rec.keys.offset(i as isize))
385+
.to_str()
386+
.unwrap()
387+
.to_string()
388+
};
389+
let value = unsafe {
390+
ffi::CStr::from_ptr(*rec.vals.offset(i as isize))
391+
.to_str()
392+
.unwrap()
393+
.to_string()
394+
};
370395
result.insert(key, value);
371396
}
372397
result

src/sam/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use std::path::Path;
1010

1111
use htslib;
1212

13+
use bam::HeaderView;
1314
use bam::header;
1415
use bam::record;
15-
use bam::HeaderView;
1616

1717
/// SAM writer.
1818
#[derive(Debug)]
@@ -111,10 +111,10 @@ quick_error! {
111111

112112
#[cfg(test)]
113113
mod tests {
114-
use bam::header;
115-
use bam::record;
116114
use bam::Read;
117115
use bam::Reader;
116+
use bam::header;
117+
use bam::record;
118118
use sam::Writer;
119119

120120
#[test]

0 commit comments

Comments
 (0)