mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -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:
@@ -1,9 +1,10 @@
|
||||
use ahash::HashMap;
|
||||
use core::task::Poll;
|
||||
use egui::{
|
||||
load::{Bytes, BytesLoadResult, BytesLoader, BytesPoll, LoadError},
|
||||
mutex::Mutex,
|
||||
};
|
||||
use std::{path::PathBuf, sync::Arc, task::Poll, thread};
|
||||
use std::{path::PathBuf, sync::Arc, thread};
|
||||
|
||||
#[derive(Clone)]
|
||||
struct File {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
use ahash::HashMap;
|
||||
use core::{mem::size_of, time::Duration};
|
||||
use egui::{
|
||||
ColorImage, FrameDurations, Id, decode_animated_image_uri, has_gif_magic_header,
|
||||
load::{BytesPoll, ImageLoadResult, ImageLoader, ImagePoll, LoadError, SizeHint},
|
||||
mutex::Mutex,
|
||||
};
|
||||
use image::AnimationDecoder as _;
|
||||
use std::{io::Cursor, mem::size_of, sync::Arc, time::Duration};
|
||||
use std::{io::Cursor, sync::Arc};
|
||||
|
||||
/// Array of Frames and the duration for how long each frame should be shown
|
||||
#[derive(Debug, Clone)]
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
use ahash::HashMap;
|
||||
use core::task::Poll;
|
||||
use egui::{
|
||||
load::{Bytes, BytesLoadResult, BytesLoader, BytesPoll, LoadError},
|
||||
mutex::Mutex,
|
||||
};
|
||||
use std::{sync::Arc, task::Poll};
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Clone)]
|
||||
struct File {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
use ahash::HashMap;
|
||||
use core::{mem::size_of, task::Poll};
|
||||
use egui::{
|
||||
ColorImage, decode_animated_image_uri,
|
||||
load::{Bytes, BytesPoll, ImageLoadResult, ImageLoader, ImagePoll, LoadError, SizeHint},
|
||||
mutex::Mutex,
|
||||
};
|
||||
use image::ImageFormat;
|
||||
use std::{mem::size_of, path::Path, sync::Arc, task::Poll};
|
||||
use std::{path::Path, sync::Arc};
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
use std::thread;
|
||||
@@ -146,7 +147,7 @@ impl ImageLoader for ImageCrateLoader {
|
||||
.map(Arc::new)
|
||||
.map_err(|err| err.to_string());
|
||||
log::trace!("finished loading {uri:?}");
|
||||
cache_lock.insert(uri.into(), std::task::Poll::Ready(result.clone()));
|
||||
cache_lock.insert(uri.into(), core::task::Poll::Ready(result.clone()));
|
||||
match result {
|
||||
Ok(image) => Ok(ImagePoll::Ready { image }),
|
||||
Err(err) => Err(LoadError::Loading(err)),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use std::{mem::size_of, sync::Arc};
|
||||
use core::mem::size_of;
|
||||
use std::sync::Arc;
|
||||
|
||||
use ahash::HashMap;
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
use ahash::HashMap;
|
||||
use core::{mem::size_of, time::Duration};
|
||||
use egui::{
|
||||
ColorImage, FrameDurations, Id, decode_animated_image_uri, has_webp_header,
|
||||
load::{BytesPoll, ImageLoadResult, ImageLoader, ImagePoll, LoadError, SizeHint},
|
||||
mutex::Mutex,
|
||||
};
|
||||
use image::{AnimationDecoder as _, ColorType, ImageDecoder as _, Rgba, codecs::webp::WebPDecoder};
|
||||
use std::{io::Cursor, mem::size_of, sync::Arc, time::Duration};
|
||||
use std::{io::Cursor, sync::Arc};
|
||||
|
||||
#[derive(Clone)]
|
||||
enum WebP {
|
||||
|
||||
Reference in New Issue
Block a user