Skip to content

Commit 1d78d12

Browse files
fix: Loosen acceptable types to support current linux build on aarch64 (#415)
* Loosen acceptable types to support current linux build on aarch64 * Fix missing import
1 parent ae79eba commit 1d78d12

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bam/record.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// except according to those terms.
55

66
use std::convert::TryFrom;
7+
use std::convert::TryInto;
78
use std::ffi;
89
use std::fmt;
910
use std::marker::PhantomData;
@@ -2216,7 +2217,7 @@ impl fmt::Display for CigarStringView {
22162217
pub struct BaseModificationMetadata {
22172218
pub strand: i32,
22182219
pub implicit: i32,
2219-
pub canonical: i8,
2220+
pub canonical: u8,
22202221
}
22212222

22222223
/// struct containing the internal state required to access
@@ -2314,7 +2315,8 @@ impl BaseModificationState<'_> {
23142315
unsafe {
23152316
let mut strand: i32 = 0;
23162317
let mut implicit: i32 = 0;
2317-
let mut canonical: i8 = 0;
2318+
// This may be i8 or u8 in hts_sys.
2319+
let mut canonical: c_char = 0;
23182320

23192321
let ret = hts_sys::bam_mods_query_type(
23202322
self.state,
@@ -2329,7 +2331,7 @@ impl BaseModificationState<'_> {
23292331
return Ok(BaseModificationMetadata {
23302332
strand,
23312333
implicit,
2332-
canonical,
2334+
canonical: canonical.try_into().unwrap(),
23332335
});
23342336
}
23352337
}

0 commit comments

Comments
 (0)