1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-04-19 19:34:24 +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 {
fn accept_mime(
&mut self,
_conn: &Connection,
_qh: &QueueHandle<Self>,
_source: &ZwlrDataControlSourceV1,
mime: Option<String>,
) {
debug!("Accepted mime type: {mime:?}");
}
// fn accept_mime(
// &mut self,
// _conn: &Connection,
// _qh: &QueueHandle<Self>,
// _source: &ZwlrDataControlSourceV1,
// mime: Option<String>,
// ) {
// debug!("Accepted mime type: {mime:?}");
// }
/// Writes the current clipboard item to 'paste' it
/// 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 trait DataControlSourceDataExt: Send + Sync {
fn data_source_data(&self) -> &DataControlSourceData;
// fn data_source_data(&self) -> &DataControlSourceData;
}
impl DataControlSourceDataExt for DataControlSourceData {
fn data_source_data(&self) -> &DataControlSourceData {
self
}
// fn data_source_data(&self) -> &DataControlSourceData {
// self
// }
}
/// 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.
pub trait DataControlSourceHandler: Sized {
/// This may be called multiple times, once for each accepted mime type from the destination, if any.
fn accept_mime(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
source: &ZwlrDataControlSourceV1,
mime: Option<String>,
);
// fn accept_mime(
// &mut self,
// conn: &Connection,
// qh: &QueueHandle<Self>,
// source: &ZwlrDataControlSourceV1,
// mime: Option<String>,
// );
/// The client has requested the data for this source to be sent.
/// Send the data, then close the fd.

View file

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

View file

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

View file

@ -409,7 +409,7 @@ impl Module<Button> for MusicModule {
// only update art when album changes
let new_cover = update.song.cover_path;
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| {
ImageProvider::parse(&cover_path, &icon_theme, false, image_size)
}) {