Use expect instead of allow for clippy cast_precision_loss (#2974)

This commit is contained in:
EvianZhang 2025-02-13 08:55:05 +08:00 committed by GitHub
parent 5281b41abb
commit f3887697ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -206,7 +206,7 @@ impl ClientStatsManager {
} }
/// Get item geometry /// Get item geometry
#[allow(clippy::cast_precision_loss)] #[expect(clippy::cast_precision_loss)]
#[cfg(feature = "std")] #[cfg(feature = "std")]
#[must_use] #[must_use]
pub fn item_geometry(&self) -> ItemGeometry { pub fn item_geometry(&self) -> ItemGeometry {

View File

@ -363,7 +363,7 @@ impl ClientStats {
} }
/// Get item geometry of current client /// Get item geometry of current client
#[allow(clippy::cast_precision_loss)] #[expect(clippy::cast_precision_loss)]
#[cfg(feature = "std")] #[cfg(feature = "std")]
#[must_use] #[must_use]
pub fn item_geometry(&self) -> ItemGeometry { pub fn item_geometry(&self) -> ItemGeometry {

View File

@ -107,7 +107,7 @@ impl StatsdMonitor {
self.statsd_client = Some(client); self.statsd_client = Some(client);
} }
#[allow(clippy::cast_precision_loss)] #[expect(clippy::cast_precision_loss)]
fn try_display(&mut self, client_stats_manager: &mut ClientStatsManager) -> Option<()> { fn try_display(&mut self, client_stats_manager: &mut ClientStatsManager) -> Option<()> {
if self.statsd_client.is_none() { if self.statsd_client.is_none() {
self.setup_statsd_client(); self.setup_statsd_client();