Fix some clippy 1.75 lints (#3754)

This commit is contained in:
Emil Ernerfeldt 2023-12-30 11:23:21 +01:00 committed by GitHub
parent 4487f8ff9f
commit 9951fe0d36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 8 deletions

View File

@ -12,8 +12,6 @@
#[cfg(feature = "cint")]
mod cint_impl;
#[cfg(feature = "cint")]
pub use cint_impl::*;
mod color32;
pub use color32::*;

View File

@ -274,7 +274,7 @@ pub fn preferred_framebuffer_format(
}
formats
.get(0)
.first()
.copied()
.ok_or(WgpuError::NoSurfaceFormatsAvailable)
}

View File

@ -43,10 +43,7 @@ impl Id {
/// Generate a new [`Id`] by hashing some source (e.g. a string or integer).
pub fn new(source: impl std::hash::Hash) -> Id {
use std::hash::{BuildHasher, Hasher};
let mut hasher = epaint::ahash::RandomState::with_seeds(1, 2, 3, 4).build_hasher();
source.hash(&mut hasher);
Id(hasher.finish())
Id(epaint::ahash::RandomState::with_seeds(1, 2, 3, 4).hash_one(source))
}
/// Generate a new [`Id`] by hashing the parent [`Id`] and the given argument.

View File

@ -1,6 +1,7 @@
//! Demo app for egui
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
#![allow(clippy::never_loop)] // False positive
// When compiling natively:
fn main() -> Result<(), eframe::Error> {

View File

@ -18,7 +18,7 @@ mod demo;
pub mod easy_mark;
pub use color_test::ColorTest;
pub use demo::DemoWindows;
pub use demo::{DemoWindows, WidgetGallery};
/// View some Rust code with syntax highlighting and selection.
pub(crate) fn rust_view_ui(ui: &mut egui::Ui, code: &str) {

View File

@ -3,6 +3,8 @@
//! Turn on the `syntect` feature for great syntax highlighting of any language.
//! Otherwise, a very simple fallback will be used, that works okish for C, C++, Rust, and Python.
#![allow(clippy::mem_forget)] // False positive from enum_map macro
use egui::text::LayoutJob;
/// View some code with syntax highlighting and selection.