<commit_before>/// Divide `n` by `divisor`, and round up to the nearest integer
/// if not evenly divisable.
#[inline]
pub fn div_round_up(n: usize, divisor: usize) -> usize {
    if n == 0 {
        0
    } else {
        (n - 1) / divisor + 1
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]<commit_msg>Add assertion that divisor isn't 0 in div_round_up<commit_after>/// Divide `n` by `divisor`, and round up to the nearest integer
/// if not evenly divisable.
#[inline]
pub fn div_round_up(n: usize, divisor: usize) -> usize {
    debug_assert!(divisor != 0, "Division by zero!");
    if n == 0 {
        0
    } else {
        (n - 1) / divisor + 1
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
{'fraction_non_alphanumeric': 0.15416098226466576, 'fraction_numerical': 0.013642564802182811, 'mean_word_length': 2.3981481481481484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1587704', 'n_tokens_mistral': 273, 'n_tokens_neox': 262, 'n_words': 89}