diff options
author | 2024-04-07 12:42:12 +0200 | |
---|---|---|
committer | 2024-04-07 12:42:12 +0200 | |
commit | 5cd98f069dea8720bca7748d6c12fa410cbe79b5 (patch) | |
tree | 99ce1271cb61c0afa84908b7bd52a94f2b2a652d /tiny_skia | |
parent | a865b380026ce8c26b818e8e94ea14cb930865a3 (diff) | |
download | iced-5cd98f069dea8720bca7748d6c12fa410cbe79b5.tar.gz iced-5cd98f069dea8720bca7748d6c12fa410cbe79b5.tar.bz2 iced-5cd98f069dea8720bca7748d6c12fa410cbe79b5.zip |
Use built-in `[lints]` table in `Cargo.toml`
Diffstat (limited to 'tiny_skia')
-rw-r--r-- | tiny_skia/Cargo.toml | 3 | ||||
-rw-r--r-- | tiny_skia/src/backend.rs | 1 | ||||
-rw-r--r-- | tiny_skia/src/geometry.rs | 1 | ||||
-rw-r--r-- | tiny_skia/src/lib.rs | 3 | ||||
-rw-r--r-- | tiny_skia/src/raster.rs | 4 | ||||
-rw-r--r-- | tiny_skia/src/text.rs | 2 | ||||
-rw-r--r-- | tiny_skia/src/vector.rs | 11 | ||||
-rw-r--r-- | tiny_skia/src/window/compositor.rs | 2 |
8 files changed, 23 insertions, 4 deletions
diff --git a/tiny_skia/Cargo.toml b/tiny_skia/Cargo.toml index 44a894a1..32ead3e0 100644 --- a/tiny_skia/Cargo.toml +++ b/tiny_skia/Cargo.toml @@ -10,6 +10,9 @@ homepage.workspace = true categories.workspace = true keywords.workspace = true +[lints] +workspace = true + [features] image = ["iced_graphics/image"] svg = ["resvg"] diff --git a/tiny_skia/src/backend.rs b/tiny_skia/src/backend.rs index 0c913c02..d0f28876 100644 --- a/tiny_skia/src/backend.rs +++ b/tiny_skia/src/backend.rs @@ -9,6 +9,7 @@ use crate::window; use std::borrow::Cow; +#[derive(Debug)] pub struct Backend { text_pipeline: crate::text::Pipeline, diff --git a/tiny_skia/src/geometry.rs b/tiny_skia/src/geometry.rs index 76482e12..9bc3664d 100644 --- a/tiny_skia/src/geometry.rs +++ b/tiny_skia/src/geometry.rs @@ -8,6 +8,7 @@ use crate::graphics::geometry::{self, Path, Style, Text}; use crate::graphics::Gradient; use crate::primitive::{self, Primitive}; +#[derive(Debug)] pub struct Frame { size: Size, transform: tiny_skia::Transform, diff --git a/tiny_skia/src/lib.rs b/tiny_skia/src/lib.rs index e7294f9b..d1f68daa 100644 --- a/tiny_skia/src/lib.rs +++ b/tiny_skia/src/lib.rs @@ -1,5 +1,4 @@ -#![forbid(rust_2018_idioms)] -#![deny(unsafe_code, unused_results, rustdoc::broken_intra_doc_links)] +#![allow(missing_docs)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] pub mod window; diff --git a/tiny_skia/src/raster.rs b/tiny_skia/src/raster.rs index 5f17ae60..176b0da9 100644 --- a/tiny_skia/src/raster.rs +++ b/tiny_skia/src/raster.rs @@ -6,6 +6,7 @@ use rustc_hash::{FxHashMap, FxHashSet}; use std::cell::RefCell; use std::collections::hash_map; +#[derive(Debug)] pub struct Pipeline { cache: RefCell<Cache>, } @@ -68,7 +69,7 @@ impl Pipeline { } } -#[derive(Default)] +#[derive(Debug, Default)] struct Cache { entries: FxHashMap<u64, Option<Entry>>, hits: FxHashSet<u64>, @@ -119,6 +120,7 @@ impl Cache { } } +#[derive(Debug)] struct Entry { width: u32, height: u32, diff --git a/tiny_skia/src/text.rs b/tiny_skia/src/text.rs index d28cc483..66ee88da 100644 --- a/tiny_skia/src/text.rs +++ b/tiny_skia/src/text.rs @@ -13,7 +13,7 @@ use std::borrow::Cow; use std::cell::RefCell; use std::collections::hash_map; -#[allow(missing_debug_implementations)] +#[derive(Debug)] pub struct Pipeline { glyph_cache: GlyphCache, cache: RefCell<Cache>, diff --git a/tiny_skia/src/vector.rs b/tiny_skia/src/vector.rs index fd1ab3de..5150cffe 100644 --- a/tiny_skia/src/vector.rs +++ b/tiny_skia/src/vector.rs @@ -9,6 +9,7 @@ use std::cell::RefCell; use std::collections::hash_map; use std::fs; +#[derive(Debug)] pub struct Pipeline { cache: RefCell<Cache>, } @@ -203,3 +204,13 @@ impl Cache { self.raster_hits.clear(); } } + +impl std::fmt::Debug for Cache { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Cache") + .field("tree_hits", &self.tree_hits) + .field("rasters", &self.rasters) + .field("raster_hits", &self.raster_hits) + .finish_non_exhaustive() + } +} diff --git a/tiny_skia/src/window/compositor.rs b/tiny_skia/src/window/compositor.rs index 25c57dc1..2350adb9 100644 --- a/tiny_skia/src/window/compositor.rs +++ b/tiny_skia/src/window/compositor.rs @@ -8,11 +8,13 @@ use crate::{Backend, Primitive, Renderer, Settings}; use std::collections::VecDeque; use std::num::NonZeroU32; +#[allow(missing_debug_implementations)] pub struct Compositor { context: softbuffer::Context<Box<dyn compositor::Window>>, settings: Settings, } +#[allow(missing_debug_implementations)] pub struct Surface { window: softbuffer::Surface< Box<dyn compositor::Window>, |