Skip to content

Commit

Permalink
chore: rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
diniamo committed Mar 25, 2024
1 parent d6fb03a commit 46d8025
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/data/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ macro_rules! implement_iterators {
vector,
name: $name:ident,
iterated_field: $iterated_field:tt,
holding_type: $holding_type:ty,
holding_type: $holding_type:ty,
) => {
impl $name {
paste!(
Expand Down Expand Up @@ -131,7 +131,7 @@ macro_rules! create_data_struct {
vector,
name: $name:ident,
command: $cmd_kind:path,
holding_type: $holding_type:ty,
holding_type: $holding_type:ty,
doc: $doc:literal
) => {
#[doc = $doc]
Expand Down
12 changes: 9 additions & 3 deletions src/event_listener/async_im.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@ impl HasAsyncExecutor for AsyncEventListener {
Event::WorkspaceDeleted(id) => arm_async!(id, workspace_destroyed_events, self),
Event::WorkspaceMoved(evend) => arm_async!(evend, workspace_moved_events, self),
Event::WorkspaceRename(even) => arm_async!(even, workspace_rename_events, self),
Event::ActiveMonitorChanged(evend) => arm_async!(evend, active_monitor_changed_events, self),
Event::ActiveWindowChangedMerged(event) => arm_async!(event, active_window_changed_events, self),
Event::ActiveMonitorChanged(evend) => {
arm_async!(evend, active_monitor_changed_events, self)
}
Event::ActiveWindowChangedMerged(event) => {
arm_async!(event, active_window_changed_events, self)
}
Event::ActiveWindowChangedV1(_) => (),
Event::ActiveWindowChangedV2(_) => (),
Event::FullscreenStateChanged(bool) => arm_async!(bool, fullscreen_state_changed_events, self),
Event::FullscreenStateChanged(bool) => {
arm_async!(bool, fullscreen_state_changed_events, self)
}
Event::MonitorAdded(monitor) => arm_async!(monitor, monitor_added_events, self),
Event::MonitorRemoved(monitor) => arm_async!(monitor, monitor_removed_events, self),
Event::WindowClosed(addr) => arm_async!(addr, window_close_events, self),
Expand Down
12 changes: 9 additions & 3 deletions src/event_listener/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ impl HasExecutor for EventListener {
self
)
}
Event::ActiveWindowChangedMerged(event) => mut_arm_sync!(event, active_window_changed_events, self),
Event::ActiveWindowChangedMerged(event) => {
mut_arm_sync!(event, active_window_changed_events, self)
}
Event::ActiveWindowChangedV1(_) => (),
Event::ActiveWindowChangedV2(_) => (),
Event::FullscreenStateChanged(bool) => mut_state_arm_sync!(
Expand All @@ -80,7 +82,9 @@ impl HasExecutor for EventListener {
Event::FloatStateChanged(even) => mut_arm_sync!(even, float_state_events, self),
Event::UrgentStateChanged(even) => mut_arm_sync!(even, urgent_state_events, self),
Event::Minimize(data) => mut_arm_sync!(data, minimize_events, self),
Event::WindowTitleChanged(addr) => mut_arm_sync!(addr, window_title_changed_events, self),
Event::WindowTitleChanged(addr) => {
mut_arm_sync!(addr, window_title_changed_events, self)
}
Event::Screencast(data) => mut_arm_sync!(data, screencast_events, self),
}
Ok(())
Expand Down Expand Up @@ -141,7 +145,9 @@ impl EventListener {
even.monitor_name.clone(),
self
),
Event::ActiveWindowChangedMerged(event) => mut_arm!(event, active_window_changed_events, self),
Event::ActiveWindowChangedMerged(event) => {
mut_arm!(event, active_window_changed_events, self)
}
Event::ActiveWindowChangedV1(_) => (),
Event::ActiveWindowChangedV2(_) => (),
Event::FullscreenStateChanged(bool) => mut_state_arm!(
Expand Down
10 changes: 4 additions & 6 deletions src/event_listener/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ pub(crate) struct ActiveWindowState {
pub(crate) trait HasExecutor {
fn event_executor(&mut self, event: Event) -> crate::Result<()>;

fn event_primer(
&mut self,
event: Event,
abuf: &mut Vec<ActiveWindowState>,
) -> crate::Result<()>
fn event_primer(&mut self, event: Event, abuf: &mut Vec<ActiveWindowState>) -> crate::Result<()>
where
Self: std::marker::Sized,
{
Expand Down Expand Up @@ -868,7 +864,9 @@ pub(crate) fn event_parser(event: String) -> crate::Result<Vec<Event>> {
ParsedEventType::ActiveWindowChangedV2 => {
let addr = &captures["address"];
if addr != "," {
events.push(Event::ActiveWindowChangedV2(Some(Address::new(format_event_addr(addr)))));
events.push(Event::ActiveWindowChangedV2(Some(Address::new(
format_event_addr(addr),
))));
} else {
events.push(Event::ActiveWindowChangedV2(None));
}
Expand Down

0 comments on commit 46d8025

Please sign in to comment.