<commit_before>#![feature(associated_types, macro_rules)]

//! Machine scalar casting that meets your expectations

/// Overflow error
pub struct Overflow;

/// Underflow error
pub struct Underflow;

/// Errors that may arise when casting from integers
pub enum FromInteger {
    Overflow,
    Underflow,
}

/// Errors that may arise when casting from floats
pub enum FromFloat {
    NaN,
    Overflow,
    Underflow,
}

/// The "casting from" operation
pub trait CastFrom<Src> {
    type Output;

    fn from(src: Src) -> Output;
}

/// The "casting to" operation
pub trait CastTo {
    fn to<Dst: CastFrom<Self>>() -> Dst::Output {
        Dst::from(self)
    }
}

macro_rules! impl_cast_to {
    ($($ty:ty),+) => {$(
        impl CastTo for $ty {})+
    }<commit_msg>fix(CastTo): add missing `self` parameter<commit_after>#![feature(associated_types, macro_rules)]

//! Machine scalar casting that meets your expectations

/// Overflow error
pub struct Overflow;

/// Underflow error
pub struct Underflow;

/// Errors that may arise when casting from integers
pub enum FromInteger {
    Overflow,
    Underflow,
}

/// Errors that may arise when casting from floats
pub enum FromFloat {
    NaN,
    Overflow,
    Underflow,
}

/// The "casting from" operation
pub trait CastFrom<Src> {
    type Output;

    fn from(src: Src) -> Output;
}

/// The "casting to" operation
pub trait CastTo {
    fn to<Dst: CastFrom<Self>>(self) -> Dst::Output {
        Dst::from(self)
    }
}

macro_rules! impl_cast_to {
    ($($ty:ty),+) => {$(
        impl CastTo for $ty {})+
    }
{'fraction_non_alphanumeric': 0.12786259541984732, 'fraction_numerical': 0.0, 'mean_word_length': 3.043701799485861, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '1136818', 'n_tokens_mistral': 517, 'n_tokens_neox': 491, 'n_words': 160}