| diff --git a/src/ber/ber.rs b/src/ber/ber.rs |
| index 6f6741d..e89b6c8 100644 |
| --- a/src/ber/ber.rs |
| +++ b/src/ber/ber.rs |
| @@ -9,6 +9,7 @@ use core::convert::From; |
| use crate::ber::integer::*; |
| use crate::error::BerError; |
| use crate::oid::Oid; |
| +#[cfg(not(any(target_os = "android", target_os = "linux")))] |
| use nom::bitvec::{order::Msb0, slice::BitSlice}; |
| use rusticata_macros::newtype_enum; |
| use std::convert::AsRef; |
| @@ -479,6 +480,7 @@ impl<'a> BerObject<'a> { |
| } |
| |
| /// Constructs a shared `&BitSlice` reference over the object data, if available as slice. |
| + #[cfg(not(any(target_os = "android", target_os = "linux")))] |
| pub fn as_bitslice(&self) -> Result<&BitSlice<Msb0, u8>, BerError> { |
| self.content.as_bitslice() |
| } |
| @@ -678,6 +680,7 @@ impl<'a> BerObjectContent<'a> { |
| } |
| |
| /// Constructs a shared `&BitSlice` reference over the object data, if available as slice. |
| + #[cfg(not(any(target_os = "android", target_os = "linux")))] |
| pub fn as_bitslice(&self) -> Result<&BitSlice<Msb0, u8>, BerError> { |
| self.as_slice() |
| .and_then(|s| BitSlice::<Msb0, _>::from_slice(s).ok_or(BerError::BerValueError)) |
| @@ -908,6 +911,7 @@ impl<'a> BitStringObject<'a> { |
| } |
| |
| /// Constructs a shared `&BitSlice` reference over the object data. |
| + #[cfg(not(any(target_os = "android", target_os = "linux")))] |
| pub fn as_bitslice(&self) -> Option<&BitSlice<Msb0, u8>> { |
| BitSlice::<Msb0, _>::from_slice(&self.data) |
| } |
| @@ -981,6 +985,7 @@ mod tests { |
| } |
| |
| #[test] |
| + #[cfg(not(any(target_os = "android", target_os = "linux")))] |
| fn test_der_bitslice() { |
| let obj = BitStringObject { |
| data: &[0x0f, 0x00, 0x40], |