mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-25 01:58:51 +02:00
refactor(clippy): impl as_ref on wm struct
This commit is contained in:
@@ -675,7 +675,7 @@ impl WindowManager {
|
|||||||
self.process_command(message.clone())?;
|
self.process_command(message.clone())?;
|
||||||
notify_subscribers(&serde_json::to_string(&Notification {
|
notify_subscribers(&serde_json::to_string(&Notification {
|
||||||
event: NotificationEvent::Socket(message.clone()),
|
event: NotificationEvent::Socket(message.clone()),
|
||||||
state: (&*self).into(),
|
state: self.as_ref().into(),
|
||||||
})?)?;
|
})?)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -478,7 +478,7 @@ impl WindowManager {
|
|||||||
serde_json::to_writer_pretty(&file, &known_hwnds)?;
|
serde_json::to_writer_pretty(&file, &known_hwnds)?;
|
||||||
notify_subscribers(&serde_json::to_string(&Notification {
|
notify_subscribers(&serde_json::to_string(&Notification {
|
||||||
event: NotificationEvent::WindowManager(*event),
|
event: NotificationEvent::WindowManager(*event),
|
||||||
state: (&*self).into(),
|
state: self.as_ref().into(),
|
||||||
})?)?;
|
})?)?;
|
||||||
|
|
||||||
tracing::info!("processed: {}", event.window().to_string());
|
tracing::info!("processed: {}", event.window().to_string());
|
||||||
|
|||||||
@@ -81,6 +81,12 @@ pub struct State {
|
|||||||
pub border_overflow_identifiers: Vec<String>,
|
pub border_overflow_identifiers: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl AsRef<Self> for WindowManager {
|
||||||
|
fn as_ref(&self) -> &Self {
|
||||||
|
self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<&WindowManager> for State {
|
impl From<&WindowManager> for State {
|
||||||
fn from(wm: &WindowManager) -> Self {
|
fn from(wm: &WindowManager) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user