mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 22:30:03 -04:00
Enable the clippy::std_instead_of_core lint (#8394)
Prefer `core::` over `std::` where either work * Part of https://github.com/emilk/egui/issues/5735
This commit is contained in:
@@ -26,7 +26,7 @@ impl<T> From<&[T]> for AllocInfo {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Add for AllocInfo {
|
||||
impl core::ops::Add for AllocInfo {
|
||||
type Output = Self;
|
||||
|
||||
fn add(self, rhs: Self) -> Self {
|
||||
@@ -47,13 +47,13 @@ impl std::ops::Add for AllocInfo {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::AddAssign for AllocInfo {
|
||||
impl core::ops::AddAssign for AllocInfo {
|
||||
fn add_assign(&mut self, rhs: Self) {
|
||||
*self = *self + rhs;
|
||||
}
|
||||
}
|
||||
|
||||
impl std::iter::Sum for AllocInfo {
|
||||
impl core::iter::Sum for AllocInfo {
|
||||
fn sum<I>(iter: I) -> Self
|
||||
where
|
||||
I: Iterator<Item = Self>,
|
||||
@@ -95,13 +95,13 @@ impl AllocInfo {
|
||||
}
|
||||
|
||||
pub fn from_slice<T>(slice: &[T]) -> Self {
|
||||
use std::mem::size_of;
|
||||
use core::mem::size_of;
|
||||
let element_size = size_of::<T>();
|
||||
Self {
|
||||
element_size: ElementSize::Homogeneous(element_size),
|
||||
num_allocs: 1,
|
||||
num_elements: slice.len(),
|
||||
num_bytes: std::mem::size_of_val(slice),
|
||||
num_bytes: core::mem::size_of_val(slice),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user