From e5c58a3c8a8a3d25bca5f83664267923a5df3d0e Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Wed, 22 Nov 2023 13:28:39 -0800 Subject: [PATCH] [cpu_shaders][flatten] Fix clippy warnings --- src/cpu_shader/flatten.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpu_shader/flatten.rs b/src/cpu_shader/flatten.rs index b6d3a1634..3db6637c2 100644 --- a/src/cpu_shader/flatten.rs +++ b/src/cpu_shader/flatten.rs @@ -332,7 +332,7 @@ fn flatten_arc( let n_lines = if theta <= ROBUST_EPSILON { MAX_LINES } else { - MAX_LINES.min((6.2831853 / theta).ceil() as u32) + MAX_LINES.min((std::f32::consts::TAU / theta).ceil() as u32) }; let th = angle / (n_lines as f32); @@ -364,7 +364,7 @@ fn draw_cap( ) { if cap_style == Style::FLAGS_CAP_BITS_ROUND { flatten_arc( - path_ix, cap0, cap1, point, 3.1415927, transform, line_ix, lines, bbox, + path_ix, cap0, cap1, point, std::f32::consts::PI, transform, line_ix, lines, bbox, ); return; } @@ -469,7 +469,7 @@ fn read_i16_point(ix: u32, pathdata: &[u32]) -> Vec2 { let raw = pathdata[ix as usize]; let x = (((raw << 16) as i32) >> 16) as f32; let y = ((raw as i32) >> 16) as f32; - return Vec2::new(x, y); + Vec2 { x, y } } #[derive(Debug)]