diff options
| author | 2023-07-12 09:03:24 +0200 | |
|---|---|---|
| committer | 2023-07-12 09:03:24 +0200 | |
| commit | 9f73ee3206c69a2db79cfb5d596b60926a829218 (patch) | |
| tree | a8b7785685bb60ba7ff1c9dcfffbd786b726f948 | |
| parent | af386fd0a3de432337ee9cdaa4d3661e98bd4105 (diff) | |
| download | iced-9f73ee3206c69a2db79cfb5d596b60926a829218.tar.gz iced-9f73ee3206c69a2db79cfb5d596b60926a829218.tar.bz2 iced-9f73ee3206c69a2db79cfb5d596b60926a829218.zip  | |
Fix import consistency for `bytemuck`
| -rw-r--r-- | tiny_skia/src/raster.rs | 6 | ||||
| -rw-r--r-- | tiny_skia/src/text.rs | 5 | ||||
| -rw-r--r-- | tiny_skia/src/vector.rs | 3 | 
3 files changed, 6 insertions, 8 deletions
diff --git a/tiny_skia/src/raster.rs b/tiny_skia/src/raster.rs index 74b21d4a..dedb127c 100644 --- a/tiny_skia/src/raster.rs +++ b/tiny_skia/src/raster.rs @@ -2,7 +2,6 @@ use crate::core::image as raster;  use crate::core::{Rectangle, Size};  use crate::graphics; -use bytemuck::cast;  use rustc_hash::{FxHashMap, FxHashSet};  use std::cell::RefCell;  use std::collections::hash_map; @@ -81,8 +80,9 @@ impl Cache {              for (i, pixel) in image.pixels().enumerate() {                  let [r, g, b, a] = pixel.0; -                buffer[i] = cast(tiny_skia::ColorU8::from_rgba(b, g, r, a) -                    .premultiply()); +                buffer[i] = bytemuck::cast( +                    tiny_skia::ColorU8::from_rgba(b, g, r, a).premultiply(), +                );              }              entry.insert(Some(Entry { diff --git a/tiny_skia/src/text.rs b/tiny_skia/src/text.rs index 58f7d145..15f25740 100644 --- a/tiny_skia/src/text.rs +++ b/tiny_skia/src/text.rs @@ -3,7 +3,6 @@ use crate::core::font::{self, Font};  use crate::core::text::{Hit, LineHeight, Shaping};  use crate::core::{Color, Pixels, Point, Rectangle, Size}; -use bytemuck::cast;  use rustc_hash::{FxHashMap, FxHashSet};  use std::borrow::Cow;  use std::cell::RefCell; @@ -289,7 +288,7 @@ impl GlyphCache {                      for _y in 0..image.placement.height {                          for _x in 0..image.placement.width { -                            buffer[i] = cast( +                            buffer[i] = bytemuck::cast(                                  tiny_skia::ColorU8::from_rgba(                                      b,                                      g, @@ -309,7 +308,7 @@ impl GlyphCache {                      for _y in 0..image.placement.height {                          for _x in 0..image.placement.width {                              // TODO: Blend alpha -                            buffer[i >> 2] = cast( +                            buffer[i >> 2] = bytemuck::cast(                                  tiny_skia::ColorU8::from_rgba(                                      image.data[i + 2],                                      image.data[i + 1], diff --git a/tiny_skia/src/vector.rs b/tiny_skia/src/vector.rs index 194fc52d..9836fb0a 100644 --- a/tiny_skia/src/vector.rs +++ b/tiny_skia/src/vector.rs @@ -1,7 +1,6 @@  use crate::core::svg::{Data, Handle};  use crate::core::{Color, Rectangle, Size}; -use bytemuck::cast;  use resvg::usvg;  use rustc_hash::{FxHashMap, FxHashSet}; @@ -157,7 +156,7 @@ impl Cache {                  for pixel in                      bytemuck::cast_slice_mut::<u8, u32>(image.data_mut())                  { -                    *pixel = cast( +                    *pixel = bytemuck::cast(                          tiny_skia::ColorU8::from_rgba(                              b,                              g,  | 
