<commit_before>use std::ops::{BitOrAssign, Shl, ShlAssign, ShrAssign, BitAnd};

pub mod read;
pub mod write;

pub use read::BitRead;
pub use read::BitReaderBE;
pub use read::BitReaderLE;

pub use write::BitWrite;
pub use write::BitWriterBE;
pub use write::BitWriterLE;

pub trait Numeric: Sized + Copy + Default +
    ShlAssign<Self> + ShrAssign<Self> + Shl<u32,Output=Self> +
    BitOrAssign<Self> + BitAnd<Self,Output=Self> {
    fn one() -> Self;
    fn from_bit(bit: bool) -> Self;
    fn to_bit(self) -> bool;
}

impl Numeric for u8 {
    #[inline]
    fn one() -> Self {1}
    #[inline]
    fn from_bit(bit: bool) -> Self {if bit {1} else {0}}
    #[inline]
    fn to_bit(self) -> bool {self != 0}
}

impl Numeric for u16 {
    #[inline]
    fn one() -> Self {1}
    #[inline]
    fn from_bit(bit: bool) -> Self {if bit {1} else {0}}
    #[inline]
    fn to_bit(self) -> bool {self != 0}
}

impl Numeric for u32 {
    #[inline]
    fn one() -> Self {1}
    #[inline]
    fn from_bit(bit: bool) -> Self {if bit {1} else {0}}
    #[inline]
    fn to_bit(self) -> bool {self != 0}
}

impl Numeric for u64 {
    #[inline]
    fn one() -> Self {1}
    #[inline]
    fn from_bit(bit: bool) -> Self {if bit {1} else {0}}
    #[inline]
    fn to_bit(self) -> bool {self != 0}
}<commit_msg>Add stronger inline suggestion to some trivial methods<commit_after>use std::ops::{BitOrAssign, Shl, ShlAssign, ShrAssign, BitAnd};

pub mod read;
pub mod write;

pub use read::BitRead;
pub use read::BitReaderBE;
pub use read::BitReaderLE;

pub use write::BitWrite;
pub use write::BitWriterBE;
pub use write::BitWriterLE;

pub trait Numeric: Sized + Copy + Default +
    ShlAssign<Self> + ShrAssign<Self> + Shl<u32,Output=Self> +
    BitOrAssign<Self> + BitAnd<Self,Output=Self> {
    fn one() -> Self;
    fn from_bit(bit: bool) -> Self;
    fn to_bit(self) -> bool;
}

impl Numeric for u8 {
    #[inline(always)]
    fn one() -> Self {1}
    #[inline(always)]
    fn from_bit(bit: bool) -> Self {if bit {1} else {0}}
    #[inline(always)]
    fn to_bit(self) -> bool {self != 0}
}

impl Numeric for u16 {
    #[inline(always)]
    fn one() -> Self {1}
    #[inline(always)]
    fn from_bit(bit: bool) -> Self {if bit {1} else {0}}
    #[inline(always)]
    fn to_bit(self) -> bool {self != 0}
}

impl Numeric for u32 {
    #[inline(always)]
    fn one() -> Self {1}
    #[inline(always)]
    fn from_bit(bit: bool) -> Self {if bit {1} else {0}}
    #[inline(always)]
    fn to_bit(self) -> bool {self != 0}
}

impl Numeric for u64 {
    #[inline(always)]
    fn one() -> Self {1}
    #[inline(always)]
    fn from_bit(bit: bool) -> Self {if bit {1} else {0}}
    #[inline(always)]
    fn to_bit(self) -> bool {self != 0}
}
{'fraction_non_alphanumeric': 0.16967908520841019, 'fraction_numerical': 0.018443378827001106, 'mean_word_length': 3.121580547112462, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5670239', 'n_tokens_mistral': 1032, 'n_tokens_neox': 1040, 'n_words': 309}