<commit_before>use std::fmt::Show;

#[derive(PartialEq, Copy)]
pub struct Dice {
    pub d4s: usize,
    pub d6s: usize,
    pub d8s: usize,
    pub d10s: usize,
    pub d12s: usize,
    pub d20s: usize,
    pub modifier: isize
}

impl Show for Dice {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        let mut buff = String::new();
        if self.d4s != 0 {
            buff.push_str(format!("{}d4 ", self.d4s).as_slice());
        }
        if self.d6s != 0 {
            buff.push_str(format!("{}d6 ", self.d6s).as_slice());
        }
        if self.d8s != 0 {
            buff.push_str(format!("{}d8 ", self.d8s).as_slice());
        }
        if self.d10s != 0 {
            buff.push_str(format!("{}d10 ", self.d10s).as_slice());
        }
        if self.d12s != 0 {
            buff.push_str(format!("{}d12 ", self.d12s).as_slice());
        }
        if self.d20s != 0 {
            buff.push_str(format!("{}d20 ", self.d20s).as_slice());
        }
        if self.modifier > 0 {
            buff.push_str(format!("+{}", self.modifier).as_slice());
        }
        if self.modifier < 0 {
            buff.push_str(format!("-{}", self.modifier).as_slice());
        }
        write!(f, "{}", buff.as_slice().trim())
    }
}<commit_msg>fixed bugged Show trait impl for dice w/ neg modifier<commit_after>use std::fmt::Show;
use std::num::SignedInt;

#[derive(PartialEq, Copy)]
pub struct Dice {
    pub d4s: usize,
    pub d6s: usize,
    pub d8s: usize,
    pub d10s: usize,
    pub d12s: usize,
    pub d20s: usize,
    pub modifier: isize
}

impl Show for Dice {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        let mut buff = String::new();
        if self.d4s != 0 {
            buff.push_str(format!("{}d4 ", self.d4s).as_slice());
        }
        if self.d6s != 0 {
            buff.push_str(format!("{}d6 ", self.d6s).as_slice());
        }
        if self.d8s != 0 {
            buff.push_str(format!("{}d8 ", self.d8s).as_slice());
        }
        if self.d10s != 0 {
            buff.push_str(format!("{}d10 ", self.d10s).as_slice());
        }
        if self.d12s != 0 {
            buff.push_str(format!("{}d12 ", self.d12s).as_slice());
        }
        if self.d20s != 0 {
            buff.push_str(format!("{}d20 ", self.d20s).as_slice());
        }
        if self.modifier > 0 {
            buff.push_str(format!("+{}", self.modifier).as_slice());
        }
        if self.modifier < 0 {
            buff.push_str(format!("-{}", self.modifier.abs()).as_slice());
        }
        write!(f, "{}", buff.as_slice().trim())
    }
}
{'fraction_non_alphanumeric': 0.18780952380952382, 'fraction_numerical': 0.033523809523809525, 'mean_word_length': 1.963882618510158, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1242122', 'n_tokens_mistral': 983, 'n_tokens_neox': 970, 'n_words': 179}