<commit_before>use crate::utils::*;
use std::f64::consts::{FRAC_PI_2, PI};

pub const TAU: f64 = 6.28318530717958647692528676655900577_f64;

/// Calculates the AABB of a arc.
pub fn arc_rect(x: f64, y: f64, radius: f64, start_angle: f64, end_angle: f64) -> Rectangle {
    // Lazy calculate the AABB of its ends.
    let (a_y, a_x) = f64::sin_cos(start_angle);
    let (b_y, b_x) = f64::sin_cos(end_angle);
    let mut start_x = a_x.min(b_x);
    let mut start_y = a_y.min(b_y);
    let mut end_x = a_x.max(b_x);
    let mut end_y = a_y.max(b_y);
    // Moves in a circle through 90° steps, checking if that angle is part of the arc and
    // if that is true, then expanding the AABB to cover that angle position too.
    let mut angle = 0.0;
    let min_angle = start_angle.min(end_angle);
    let max_angle = start_angle.max(end_angle);
    let mut i = 0;
    while angle < f64::to_radians(360.0) {
        if angle >= min_angle && angle <= max_angle {
            let (x, y) = match i {
                0 => (1.0, 0.0),
                1 => (0.0, 1.0),
                2 => (-1.0, 0.0),
                3 => (0.0, -1.0),
                _ => break, // Error with the comparison in the while head?, no matters, break the loop.
            };
            start_x = start_x.min(x);
            start_y = start_y.min(y);
            end_x = end_x.max(x);<commit_msg>fix clippy<commit_after>use crate::utils::*;
use std::f64::consts::{FRAC_PI_2, PI};

pub const TAU: f64 = 6.283_185_307_179_586_f64;

/// Calculates the AABB of a arc.
pub fn arc_rect(x: f64, y: f64, radius: f64, start_angle: f64, end_angle: f64) -> Rectangle {
    // Lazy calculate the AABB of its ends.
    let (a_y, a_x) = f64::sin_cos(start_angle);
    let (b_y, b_x) = f64::sin_cos(end_angle);
    let mut start_x = a_x.min(b_x);
    let mut start_y = a_y.min(b_y);
    let mut end_x = a_x.max(b_x);
    let mut end_y = a_y.max(b_y);
    // Moves in a circle through 90° steps, checking if that angle is part of the arc and
    // if that is true, then expanding the AABB to cover that angle position too.
    let mut angle = 0.0;
    let min_angle = start_angle.min(end_angle);
    let max_angle = start_angle.max(end_angle);
    let mut i = 0;
    while angle < f64::to_radians(360.0) {
        if angle >= min_angle && angle <= max_angle {
            let (x, y) = match i {
                0 => (1.0, 0.0),
                1 => (0.0, 1.0),
                2 => (-1.0, 0.0),
                3 => (0.0, -1.0),
                _ => break, // Error with the comparison in the while head?, no matters, break the loop.
            };
            start_x = start_x.min(x);
            start_y = start_y.min(y);
            end_x = end_x.max(x);
{'fraction_non_alphanumeric': 0.13564319941024697, 'fraction_numerical': 0.05750092148912643, 'mean_word_length': 2.155813953488372, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '4634833', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1025, 'n_words': 300}