1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40: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:
Emil Ernerfeldt
2026-08-06 04:19:13 -07:00
committed by GitHub
parent 2a5f3d99b5
commit 6aea7eff94
176 changed files with 633 additions and 615 deletions

View File

@@ -55,10 +55,10 @@ impl TextureWrapModeExt for egui::TextureWrapMode {
#[derive(Debug)]
pub struct PainterError(String);
impl std::error::Error for PainterError {}
impl core::error::Error for PainterError {}
impl std::fmt::Display for PainterError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
impl core::fmt::Display for PainterError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "OpenGL: {}", self.0)
}
}
@@ -219,7 +219,7 @@ impl Painter {
let a_tc_loc = gl.get_attrib_location(program, "a_tc").unwrap();
let a_srgba_loc = gl.get_attrib_location(program, "a_srgba").unwrap();
let stride = std::mem::size_of::<Vertex>() as i32;
let stride = core::mem::size_of::<Vertex>() as i32;
let buffer_infos = vec![
vao::BufferInfo {
location: a_pos_loc,

View File

@@ -2,7 +2,7 @@
#![expect(clippy::unwrap_used)] // TODO(emilk): avoid unwraps
#![expect(unsafe_code)]
use std::convert::TryInto as _;
use core::convert::TryInto as _;
/// Helper for parsing and interpreting the OpenGL shader version.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]

View File

@@ -104,8 +104,8 @@ impl EguiGlow {
/// Paint the results of the last call to [`Self::run`].
pub fn paint(&mut self, window: &winit::window::Window) {
let shapes = std::mem::take(&mut self.shapes);
let mut textures_delta = std::mem::take(&mut self.textures_delta);
let shapes = core::mem::take(&mut self.shapes);
let mut textures_delta = core::mem::take(&mut self.textures_delta);
#[expect(clippy::iter_over_hash_type)] // Order doesn't matter here
for (id, image_deltas) in textures_delta.set.drain() {