Skip to content

Commit

Permalink
refactor: fix latest clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeStanger committed May 11, 2024
1 parent f78a062 commit 04a694e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
18 changes: 9 additions & 9 deletions src/clients/wayland/wlr_data_control/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 11 additions & 11 deletions src/clients/wayland/wlr_data_control/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ 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.
///
/// 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.
Expand Down
2 changes: 1 addition & 1 deletion src/ironvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/modules/launcher/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/music/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}) {
Expand Down

0 comments on commit 04a694e

Please sign in to comment.