Skip to content

Commit

Permalink
fix: Loosen acceptable types to support current linux build on aarch64 (
Browse files Browse the repository at this point in the history
#415)

* Loosen acceptable types to support current linux build on aarch64

* Fix missing import
  • Loading branch information
rdeaton-freenome authored Feb 7, 2024
1 parent ae79eba commit 1d78d12
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bam/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// except according to those terms.

use std::convert::TryFrom;
use std::convert::TryInto;
use std::ffi;
use std::fmt;
use std::marker::PhantomData;
Expand Down Expand Up @@ -2216,7 +2217,7 @@ impl fmt::Display for CigarStringView {
pub struct BaseModificationMetadata {
pub strand: i32,
pub implicit: i32,
pub canonical: i8,
pub canonical: u8,
}

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

let ret = hts_sys::bam_mods_query_type(
self.state,
Expand All @@ -2329,7 +2331,7 @@ impl BaseModificationState<'_> {
return Ok(BaseModificationMetadata {
strand,
implicit,
canonical,
canonical: canonical.try_into().unwrap(),
});

Check warning on line 2335 in src/bam/record.rs

View workflow job for this annotation

GitHub Actions / clippy

unneeded `return` statement

warning: unneeded `return` statement --> src/bam/record.rs:2331:17 | 2331 | / return Ok(BaseModificationMetadata { 2332 | | strand, 2333 | | implicit, 2334 | | canonical: canonical.try_into().unwrap(), 2335 | | }); | |__________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 2331 ~ Ok(BaseModificationMetadata { 2332 + strand, 2333 + implicit, 2334 + canonical: canonical.try_into().unwrap(), 2335 ~ }) |
}
}
Expand Down

0 comments on commit 1d78d12

Please sign in to comment.