1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-01 18:51:04 +02:00

refactor: fix latest clippy warnings

This commit is contained in:
Jake Stanger 2024-05-11 20:55:43 +01:00
parent f78a062f3a
commit 04a694e2ad
5 changed files with 24 additions and 24 deletions

View file

@ -294,15 +294,15 @@ impl DataControlOfferHandler for Environment {
} }
impl DataControlSourceHandler for Environment { impl DataControlSourceHandler for Environment {
fn accept_mime( // fn accept_mime(
&mut self, // &mut self,
_conn: &Connection, // _conn: &Connection,
_qh: &QueueHandle<Self>, // _qh: &QueueHandle<Self>,
_source: &ZwlrDataControlSourceV1, // _source: &ZwlrDataControlSourceV1,
mime: Option<String>, // mime: Option<String>,
) { // ) {
debug!("Accepted mime type: {mime:?}"); // debug!("Accepted mime type: {mime:?}");
} // }
/// Writes the current clipboard item to 'paste' it /// Writes the current clipboard item to 'paste' it
/// upon request from a compositor client. /// upon request from a compositor client.

View file

@ -10,13 +10,13 @@ use wayland_protocols_wlr::data_control::v1::client::zwlr_data_control_source_v1
pub struct DataControlSourceData {} pub struct DataControlSourceData {}
pub trait DataControlSourceDataExt: Send + Sync { pub trait DataControlSourceDataExt: Send + Sync {
fn data_source_data(&self) -> &DataControlSourceData; // fn data_source_data(&self) -> &DataControlSourceData;
} }
impl DataControlSourceDataExt for DataControlSourceData { impl DataControlSourceDataExt for DataControlSourceData {
fn data_source_data(&self) -> &DataControlSourceData { // fn data_source_data(&self) -> &DataControlSourceData {
self // self
} // }
} }
/// Handler trait for `DataSource` events. /// Handler trait for `DataSource` events.
@ -24,13 +24,13 @@ impl DataControlSourceDataExt for DataControlSourceData {
/// The functions defined in this trait are called as `DataSource` events are received from the compositor. /// The functions defined in this trait are called as `DataSource` events are received from the compositor.
pub trait DataControlSourceHandler: Sized { pub trait DataControlSourceHandler: Sized {
/// This may be called multiple times, once for each accepted mime type from the destination, if any. /// This may be called multiple times, once for each accepted mime type from the destination, if any.
fn accept_mime( // fn accept_mime(
&mut self, // &mut self,
conn: &Connection, // conn: &Connection,
qh: &QueueHandle<Self>, // qh: &QueueHandle<Self>,
source: &ZwlrDataControlSourceV1, // source: &ZwlrDataControlSourceV1,
mime: Option<String>, // mime: Option<String>,
); // );
/// The client has requested the data for this source to be sent. /// The client has requested the data for this source to be sent.
/// Send the data, then close the fd. /// Send the data, then close the fd.

View file

@ -93,7 +93,7 @@ impl IronVar {
/// Sets the current variable value. /// Sets the current variable value.
/// The change is broadcast to all receivers. /// The change is broadcast to all receivers.
fn set(&mut self, value: Option<String>) { fn set(&mut self, value: Option<String>) {
self.value = value.clone(); self.value.clone_from(&value);
send!(self.tx, value); send!(self.tx, value);
} }

View file

@ -40,7 +40,7 @@ impl Item {
let id = info.id; let id = info.id;
if self.windows.is_empty() { if self.windows.is_empty() {
self.name = info.title.clone(); self.name.clone_from(&info.title);
} }
let window = Window::from(info); let window = Window::from(info);
@ -59,7 +59,7 @@ impl Item {
pub fn set_window_name(&mut self, window_id: usize, name: String) { pub fn set_window_name(&mut self, window_id: usize, name: String) {
if let Some(window) = self.windows.get_mut(&window_id) { if let Some(window) = self.windows.get_mut(&window_id) {
if let OpenState::Open { focused: true, .. } = window.open_state { if let OpenState::Open { focused: true, .. } = window.open_state {
self.name = name.clone(); self.name.clone_from(&name);
} }
window.name = name; window.name = name;

View file

@ -409,7 +409,7 @@ impl Module<Button> for MusicModule {
// only update art when album changes // only update art when album changes
let new_cover = update.song.cover_path; let new_cover = update.song.cover_path;
if prev_cover != new_cover { if prev_cover != new_cover {
prev_cover = new_cover.clone(); prev_cover.clone_from(&new_cover);
let res = if let Some(image) = new_cover.and_then(|cover_path| { let res = if let Some(image) = new_cover.and_then(|cover_path| {
ImageProvider::parse(&cover_path, &icon_theme, false, image_size) ImageProvider::parse(&cover_path, &icon_theme, false, image_size)
}) { }) {