From 994e727f246008547147c6c7aa3f53f55e196028 Mon Sep 17 00:00:00 2001 From: Olivier FAURE Date: Thu, 30 Oct 2025 14:01:17 +0100 Subject: [PATCH] Remove superfluous CoreFloat imports --- fontique/src/attributes.rs | 4 ++-- parley/src/layout/data.rs | 4 ---- parley/src/layout/line_break.rs | 4 ++-- parley/src/util.rs | 4 ---- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/fontique/src/attributes.rs b/fontique/src/attributes.rs index 8d7dc7bc..88928b5a 100644 --- a/fontique/src/attributes.rs +++ b/fontique/src/attributes.rs @@ -4,8 +4,8 @@ //! Properties for specifying font weight, width and style. #[cfg(feature = "libm")] -#[allow(unused_imports)] -use core_maths::CoreFloat; +#[cfg_attr(feature = "std", allow(unused_imports))] +use core_maths::CoreFloat as _; use core::fmt; diff --git a/parley/src/layout/data.rs b/parley/src/layout/data.rs index cbea7318..d9ec47fa 100644 --- a/parley/src/layout/data.rs +++ b/parley/src/layout/data.rs @@ -12,10 +12,6 @@ use swash::text::cluster::{Boundary, Whitespace}; use alloc::vec::Vec; -#[cfg(feature = "libm")] -#[allow(unused_imports)] -use core_maths::CoreFloat; - #[derive(Copy, Clone, Debug, PartialEq)] pub(crate) struct ClusterData { pub(crate) info: ClusterInfo, diff --git a/parley/src/layout/line_break.rs b/parley/src/layout/line_break.rs index 293bf01c..65b6faed 100644 --- a/parley/src/layout/line_break.rs +++ b/parley/src/layout/line_break.rs @@ -7,8 +7,8 @@ use alloc::vec::Vec; use swash::text::cluster::Whitespace; #[cfg(feature = "libm")] -#[allow(unused_imports)] -use core_maths::CoreFloat; +#[cfg_attr(feature = "std", allow(unused_imports))] +use core_maths::CoreFloat as _; use crate::OverflowWrap; use crate::layout::{ diff --git a/parley/src/util.rs b/parley/src/util.rs index ce0d698a..6c114602 100644 --- a/parley/src/util.rs +++ b/parley/src/util.rs @@ -3,10 +3,6 @@ //! Misc helpers. -#[cfg(feature = "libm")] -#[allow(unused_imports)] -use core_maths::CoreFloat; - pub(crate) fn nearly_eq(x: f32, y: f32) -> bool { (x - y).abs() < f32::EPSILON }