diff --git a/eframe/examples/custom_3d.rs b/eframe/examples/custom_3d.rs index 54f9bf8e..6c4b5e6f 100644 --- a/eframe/examples/custom_3d.rs +++ b/eframe/examples/custom_3d.rs @@ -7,6 +7,7 @@ //! * [`three-d`](https://github.com/asny/three-d) #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release +#![allow(unsafe_code)] use eframe::egui; @@ -57,7 +58,7 @@ impl eframe::App for MyApp { } fn on_exit(&mut self, gl: &glow::Context) { - self.rotating_triangle.lock().destroy(gl) + self.rotating_triangle.lock().destroy(gl); } } diff --git a/eframe/examples/download_image.rs b/eframe/examples/download_image.rs index 9cbb51d1..71ac412a 100644 --- a/eframe/examples/download_image.rs +++ b/eframe/examples/download_image.rs @@ -50,6 +50,7 @@ impl eframe::App for MyApp { } } +#[allow(clippy::needless_pass_by_value)] fn parse_response(response: ehttp::Response) -> Result { let content_type = response.content_type().unwrap_or_default(); if content_type.starts_with("image/") { diff --git a/egui_demo_app/src/lib.rs b/egui_demo_app/src/lib.rs index a4444edf..e81aba48 100644 --- a/egui_demo_app/src/lib.rs +++ b/egui_demo_app/src/lib.rs @@ -1,3 +1,5 @@ +//! Demo app for egui + #[cfg(target_arch = "wasm32")] use eframe::wasm_bindgen::{self, prelude::*}; diff --git a/egui_demo_app/src/main.rs b/egui_demo_app/src/main.rs index c99e2688..6d747f0f 100644 --- a/egui_demo_app/src/main.rs +++ b/egui_demo_app/src/main.rs @@ -1,3 +1,5 @@ +//! Demo app for egui + #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release // When compiling natively: diff --git a/egui_demo_lib/benches/benchmark.rs b/egui_demo_lib/benches/benchmark.rs index 9b988b3f..9038187f 100644 --- a/egui_demo_lib/benches/benchmark.rs +++ b/egui_demo_lib/benches/benchmark.rs @@ -17,7 +17,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { demo_windows.ui(ctx); }); ctx.tessellate(full_output.shapes) - }) + }); }); c.bench_function("demo_no_tessellate", |b| { @@ -25,14 +25,14 @@ pub fn criterion_benchmark(c: &mut Criterion) { ctx.run(RawInput::default(), |ctx| { demo_windows.ui(ctx); }) - }) + }); }); let full_output = ctx.run(RawInput::default(), |ctx| { demo_windows.ui(ctx); }); c.bench_function("demo_only_tessellate", |b| { - b.iter(|| ctx.tessellate(full_output.shapes.clone())) + b.iter(|| ctx.tessellate(full_output.shapes.clone())); }); } @@ -45,7 +45,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { ctx.run(RawInput::default(), |ctx| { demo_windows.ui(ctx); }) - }) + }); }); } @@ -56,12 +56,12 @@ pub fn criterion_benchmark(c: &mut Criterion) { c.bench_function("label &str", |b| { b.iter(|| { ui.label("the quick brown fox jumps over the lazy dog"); - }) + }); }); c.bench_function("label format!", |b| { b.iter(|| { ui.label("the quick brown fox jumps over the lazy dog".to_owned()); - }) + }); }); }); }); @@ -77,7 +77,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { let rect = ui.max_rect(); b.iter(|| { painter.rect(rect, 2.0, egui::Color32::RED, (1.0, egui::Color32::WHITE)); - }) + }); }); }); @@ -108,7 +108,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { wrap_width, ); layout(&mut locked_fonts.fonts, job.into()) - }) + }); }); } c.bench_function("text_layout_cached", |b| { @@ -119,7 +119,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { color, wrap_width, ) - }) + }); }); let galley = fonts.layout(LOREM_IPSUM_LONG.to_owned(), font_id, color, wrap_width); @@ -131,7 +131,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { b.iter(|| { tessellator.tessellate_text(font_image_size, &text_shape, &mut mesh); mesh.clear(); - }) + }); }); } } diff --git a/egui_glium/examples/native_texture.rs b/egui_glium/examples/native_texture.rs index 8d65c528..abaafd46 100644 --- a/egui_glium/examples/native_texture.rs +++ b/egui_glium/examples/native_texture.rs @@ -1,4 +1,4 @@ -//! Example how to use [epi::NativeTexture] with glium. +//! Example how to use [`epi::NativeTexture`] with glium. #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release @@ -111,7 +111,7 @@ fn create_display(event_loop: &glutin::event_loop::EventLoop<()>) -> glium::Disp glium::Display::new(window_builder, context_builder, event_loop).unwrap() } -fn load_glium_image(png_data: &[u8]) -> glium::texture::RawImage2d { +fn load_glium_image(png_data: &[u8]) -> glium::texture::RawImage2d<'_, u8> { // Load image using the image crate: let image = image::load_from_memory(png_data).unwrap().to_rgba8(); let image_dimensions = image.dimensions(); diff --git a/egui_glow/examples/pure_glow.rs b/egui_glow/examples/pure_glow.rs index 06abc5c2..173654b8 100644 --- a/egui_glow/examples/pure_glow.rs +++ b/egui_glow/examples/pure_glow.rs @@ -1,6 +1,7 @@ //! Example how to use pure `egui_glow` without [`epi`]. #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release +#![allow(unsafe_code)] fn main() { let mut clear_color = [0.1, 0.1, 0.1];