mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 08:28:12 +08:00
Fix clippy lints (#1327)
* Fix clippy lints * Update formatting * Remove unsafe send impls * New type for Rc<NodeContainer>
This commit is contained in:
committed by
Keavon Chambers
parent
743803ce04
commit
80cc5bee73
@@ -209,7 +209,7 @@ impl Bezier {
|
||||
let self_points = self.get_points().collect::<Vec<DVec2>>();
|
||||
let other_points = other.get_points().collect::<Vec<DVec2>>();
|
||||
|
||||
self_points.len() == other_points.len() && self_points.into_iter().zip(other_points.into_iter()).all(|(a, b)| a.abs_diff_eq(b, max_abs_diff))
|
||||
self_points.len() == other_points.len() && self_points.into_iter().zip(other_points).all(|(a, b)| a.abs_diff_eq(b, max_abs_diff))
|
||||
}
|
||||
|
||||
/// Returns true if the start, end and handles of the Bezier are all at the same location
|
||||
|
||||
@@ -1010,7 +1010,7 @@ mod tests {
|
||||
fn test_arcs_cubic() {
|
||||
let bezier = Bezier::from_cubic_coordinates(30., 30., 30., 80., 60., 80., 60., 140.);
|
||||
let actual_arcs = bezier.arcs(ArcsOptions::default());
|
||||
let expected_arcs = vec![
|
||||
let expected_arcs = [
|
||||
CircleArc {
|
||||
center: DVec2::new(122.394877, 30.7777189),
|
||||
radius: 92.39815,
|
||||
|
||||
@@ -22,7 +22,7 @@ pub fn compare_points(p1: DVec2, p2: DVec2) -> bool {
|
||||
/// Compare vectors of points by allowing some maximum absolute difference to account for floating point errors
|
||||
#[cfg(test)]
|
||||
pub fn compare_vec_of_points(a: Vec<DVec2>, b: Vec<DVec2>, max_absolute_difference: f64) -> bool {
|
||||
a.len() == b.len() && a.into_iter().zip(b.into_iter()).all(|(p1, p2)| p1.abs_diff_eq(p2, max_absolute_difference))
|
||||
a.len() == b.len() && a.into_iter().zip(b).all(|(p1, p2)| p1.abs_diff_eq(p2, max_absolute_difference))
|
||||
}
|
||||
|
||||
/// Compare circle arcs by allowing some maximum absolute difference between values to account for floating point errors
|
||||
|
||||
@@ -324,7 +324,7 @@ mod tests {
|
||||
|
||||
/// Compare vectors of `f64`s with a provided max absolute value difference.
|
||||
fn f64_compare_vector(vec1: Vec<f64>, vec2: Vec<f64>, max_abs_diff: f64) -> bool {
|
||||
vec1.len() == vec2.len() && vec1.into_iter().zip(vec2.into_iter()).all(|(a, b)| f64_compare(a, b, max_abs_diff))
|
||||
vec1.len() == vec2.len() && vec1.into_iter().zip(vec2).all(|(a, b)| f64_compare(a, b, max_abs_diff))
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user