1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Move lints list to .carg/config.toml (#1394)

That way they apply to all crates equally.

See https://github.com/EmbarkStudios/rust-ecosystem/issues/22 for why.
This commit is contained in:
Emil Ernerfeldt
2022-03-21 16:54:29 +01:00
committed by GitHub
parent ccbddcfe95
commit fda8189cba
17 changed files with 96 additions and 664 deletions

View File

@@ -66,7 +66,7 @@ fn web_location() -> epi::Location {
let query_map = parse_query_map(&query)
.iter()
.map(|(k, v)| (k.to_string(), v.to_string()))
.map(|(k, v)| ((*k).to_string(), (*v).to_string()))
.collect();
epi::Location {

View File

@@ -50,7 +50,7 @@ impl WrappedGlowPainter {
pub fn clear(&mut self, clear_color: Rgba) {
let canvas_dimension = [self.canvas.width(), self.canvas.height()];
egui_glow::painter::clear(self.painter.gl(), canvas_dimension, clear_color)
egui_glow::painter::clear(self.painter.gl(), canvas_dimension, clear_color);
}
pub fn paint_primitives(

View File

@@ -4,10 +4,7 @@
//!
//! If you are writing an app, you may want to look at [`eframe`](https://docs.rs/eframe) instead.
// Forbid warnings in release builds:
#![cfg_attr(not(debug_assertions), deny(warnings))]
#![forbid(unsafe_code)]
#![warn(clippy::all, rustdoc::missing_crate_level_docs, rust_2018_idioms)]
#![allow(clippy::missing_errors_doc)] // So many `-> Result<_, JsValue>`
pub mod backend;
mod glow_wrapping;
@@ -891,11 +888,11 @@ pub(crate) fn webgl1_requires_brightening(gl: &web_sys::WebGlRenderingContext) -
!user_agent.contains("Mac OS X") && crate::is_safari_and_webkit_gtk(gl)
}
/// detecting Safari and webkitGTK.
/// detecting Safari and `webkitGTK`.
///
/// Safari and webkitGTK use unmasked renderer :Apple GPU
/// Safari and `webkitGTK` use unmasked renderer :Apple GPU
///
/// If we detect safari or webkitGTK returns true.
/// If we detect safari or `webkitGTKs` returns true.
///
/// This function used to avoid displaying linear color with `sRGB` supported systems.
fn is_safari_and_webkit_gtk(gl: &web_sys::WebGlRenderingContext) -> bool {

View File

@@ -29,6 +29,7 @@ impl Default for ScreenReader {
impl ScreenReader {
#[cfg(not(feature = "screen_reader"))]
#[allow(clippy::unused_self)]
pub fn speak(&mut self, _text: &str) {}
#[cfg(feature = "screen_reader")]

View File

@@ -161,7 +161,7 @@ pub fn update_text_agent(runner: MutexGuard<'_, AppRunner>) -> Option<()> {
let delta = delta.max(-keyboard_fraction); // Don't move it crazy much
let new_pos_percent = (delta * 100.0).round().to_string() + "%";
let new_pos_percent = format!("{}%", (delta * 100.0).round());
canvas_style.set_property("position", "absolute").ok()?;
canvas_style.set_property("top", &new_pos_percent).ok()?;
@@ -217,8 +217,8 @@ pub fn move_text_cursor(cursor: Option<egui::Pos2>, canvas_id: &str) -> Option<(
let x = (x - canvas.offset_width() as f32 / 2.0)
.min(canvas.client_width() as f32 - bounding_rect.width() as f32);
style.set_property("position", "absolute").ok()?;
style.set_property("top", &(y.to_string() + "px")).ok()?;
style.set_property("left", &(x.to_string() + "px")).ok()
style.set_property("top", &format!("{}px", y)).ok()?;
style.set_property("left", &format!("{}px", x)).ok()
})
} else {
style.set_property("position", "absolute").ok()?;