From 1a2b1706064667350c4e627dd222493c2b9fca9c Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 29 Dec 2020 14:39:41 +0100 Subject: [PATCH] Make clippy happy This fixes the following clippy warnings: error: usage of `Rc` when T is a buffer type --> src/wayland/dmabuf/mod.rs:265:14 | 265 | formats: Rc>, | ^^^^^^^^^^^^^^^ help: try: `Rc<[Format]>` | = note: `-D clippy::rc-buffer` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#rc_buffer error: usage of `Rc` when T is a buffer type --> src/wayland/shm/mod.rs:91:14 | 91 | formats: Rc>, | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Rc<[wl_shm::Format]>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#rc_buffer Signed-off-by: Uli Schlachter --- src/wayland/dmabuf/mod.rs | 4 ++-- src/wayland/shm/mod.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wayland/dmabuf/mod.rs b/src/wayland/dmabuf/mod.rs index af8a681..7ebb0c7 100644 --- a/src/wayland/dmabuf/mod.rs +++ b/src/wayland/dmabuf/mod.rs @@ -186,7 +186,7 @@ where let log = crate::slog_or_fallback(logger).new(o!("smithay_module" => "dmabuf_handler")); let max_planes = formats.iter().map(|f| f.plane_count).max().unwrap_or(0); - let formats = Rc::new(formats); + let formats = Rc::<[Format]>::from(formats); let handler = Rc::new(RefCell::new(handler)); trace!( @@ -262,7 +262,7 @@ struct ParamsHandler { pending_planes: Vec, max_planes: u32, used: bool, - formats: Rc>, + formats: Rc<[Format]>, handler: Rc>, log: ::slog::Logger, } diff --git a/src/wayland/shm/mod.rs b/src/wayland/shm/mod.rs index 444deaa..b86e945 100644 --- a/src/wayland/shm/mod.rs +++ b/src/wayland/shm/mod.rs @@ -88,7 +88,7 @@ mod pool; /// This type is only visible as type parameter of /// the `Global` handle you are provided. pub struct ShmGlobalData { - formats: Rc>, + formats: Rc<[wl_shm::Format]>, log: ::slog::Logger, } @@ -115,7 +115,7 @@ where formats.push(wl_shm::Format::Argb8888); formats.push(wl_shm::Format::Xrgb8888); let data = ShmGlobalData { - formats: Rc::new(formats), + formats: formats.into(), log: log.new(o!("smithay_module" => "shm_handler")), };