[egui] Enable a bunch of clippy warnings

This commit is contained in:
Emil Ernerfeldt 2020-11-28 10:54:01 +01:00
parent 8de74e4250
commit aec97c74b9
5 changed files with 19 additions and 3 deletions

View file

@ -160,6 +160,7 @@ impl Prepared {
) )
} }
#[allow(clippy::needless_pass_by_value)] // intentional to swallow up `content_ui`.
pub(crate) fn end(self, ctx: &Arc<Context>, content_ui: Ui) -> Response { pub(crate) fn end(self, ctx: &Arc<Context>, content_ui: Ui) -> Response {
let Prepared { let Prepared {
layer_id, layer_id,

View file

@ -295,7 +295,7 @@ impl<'open> Window<'open> {
title_bar.ui( title_bar.ui(
&mut area_content_ui, &mut area_content_ui,
outer_rect, outer_rect,
content_response, &content_response,
open, open,
&mut collapsing, &mut collapsing,
collapsible, collapsible,
@ -659,7 +659,7 @@ impl TitleBar {
mut self, mut self,
ui: &mut Ui, ui: &mut Ui,
outer_rect: Rect, outer_rect: Rect,
content_response: Option<Response>, content_response: &Option<Response>,
open: Option<&mut bool>, open: Option<&mut bool>,
collapsing: &mut collapsing_header::State, collapsing: &mut collapsing_header::State,
collapsible: bool, collapsible: bool,

View file

@ -38,20 +38,34 @@
#![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds #![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds
#![warn( #![warn(
clippy::all, clippy::all,
clippy::await_holding_lock,
clippy::dbg_macro, clippy::dbg_macro,
clippy::doc_markdown, clippy::doc_markdown,
clippy::empty_enum, clippy::empty_enum,
clippy::enum_glob_use, clippy::enum_glob_use,
clippy::exit,
clippy::filter_map_next, clippy::filter_map_next,
clippy::fn_params_excessive_bools, clippy::fn_params_excessive_bools,
clippy::if_let_mutex,
clippy::imprecise_flops, clippy::imprecise_flops,
clippy::inefficient_to_string,
clippy::linkedlist,
clippy::lossy_float_literal, clippy::lossy_float_literal,
clippy::macro_use_imports,
clippy::match_on_vec_items,
clippy::match_wildcard_for_single_variants,
clippy::mem_forget, clippy::mem_forget,
clippy::mismatched_target_os,
clippy::needless_borrow, clippy::needless_borrow,
clippy::needless_continue, clippy::needless_continue,
clippy::needless_pass_by_value,
clippy::option_option,
clippy::pub_enum_variant_names, clippy::pub_enum_variant_names,
clippy::rest_pat_in_fully_bound_structs, clippy::rest_pat_in_fully_bound_structs,
clippy::todo, clippy::todo,
clippy::unimplemented,
clippy::unnested_or_patterns,
clippy::verbose_file_reads,
future_incompatible, future_incompatible,
nonstandard_style, nonstandard_style,
rust_2018_idioms rust_2018_idioms

View file

@ -1,3 +1,5 @@
#![allow(clippy::needless_pass_by_value)] // False positives with `impl ToString`
use std::ops::RangeInclusive; use std::ops::RangeInclusive;
use crate::{paint::*, *}; use crate::{paint::*, *};

View file

@ -51,7 +51,6 @@ impl egui::app::App for ExampleApp {
if let Ok(result) = receiver.try_recv() { if let Ok(result) = receiver.try_recv() {
self.in_progress = None; self.in_progress = None;
self.result = Some(result.map(Resource::from_response)); self.result = Some(result.map(Resource::from_response));
} else {
} }
} }