Skip to content

Commit 5cb9965

Browse files
committed
fix lint
1 parent 2e9ea3b commit 5cb9965

File tree

6 files changed

+35
-39
lines changed

6 files changed

+35
-39
lines changed

frontends/rioterm/src/application.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,7 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
205205
if let Some(ctx_item) =
206206
route.window.screen.ctx_mut().get_mut(route_id)
207207
{
208-
ctx_item
209-
.val
210-
.renderable_content
211-
.pending_update
212-
.set_dirty();
208+
ctx_item.val.renderable_content.pending_update.set_dirty();
213209
}
214210

215211
// Check if we need to throttle based on timing
@@ -268,11 +264,7 @@ impl ApplicationHandler<EventPayload> for Application<'_> {
268264
if let Some(ctx_item) =
269265
route.window.screen.ctx_mut().get_mut(route_id)
270266
{
271-
ctx_item
272-
.val
273-
.renderable_content
274-
.pending_update
275-
.set_dirty();
267+
ctx_item.val.renderable_content.pending_update.set_dirty();
276268
route.schedule_redraw(&mut self.scheduler, route_id);
277269
}
278270
}

frontends/rioterm/src/context/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ impl<T: EventListener> Context<T> {
8282

8383
#[inline]
8484
pub fn set_hyperlink_range(&mut self, hyperlink_range: Option<SelectionRange>) {
85-
let old_hyperlink = self.renderable_content.hyperlink_range.clone();
86-
85+
let old_hyperlink = self.renderable_content.hyperlink_range;
86+
8787
if old_hyperlink != hyperlink_range {
8888
// For hyperlinks, use full damage as they're less frequent
8989
self.renderable_content
9090
.pending_update
9191
.set_ui_damage(rio_backend::event::TerminalDamage::Full);
9292
}
93-
93+
9494
self.renderable_content.hyperlink_range = hyperlink_range;
9595
}
9696

frontends/rioterm/src/context/renderable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ impl PendingUpdate {
133133
TerminalDamage::Partial(lines1)
134134
}
135135
// CursorOnly damages need special handling
136-
(TerminalDamage::CursorOnly, TerminalDamage::Partial(lines)) |
137-
(TerminalDamage::Partial(lines), TerminalDamage::CursorOnly) => {
136+
(TerminalDamage::CursorOnly, TerminalDamage::Partial(lines))
137+
| (TerminalDamage::Partial(lines), TerminalDamage::CursorOnly) => {
138138
TerminalDamage::Partial(lines)
139139
}
140140
(TerminalDamage::CursorOnly, TerminalDamage::CursorOnly) => {

frontends/rioterm/src/renderer/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,10 @@ impl Renderer {
875875
(Some(term), Some(ui)) => {
876876
// Merge partial damages
877877
match (term, ui) {
878-
(TerminalDamage::Partial(mut lines1), TerminalDamage::Partial(lines2)) => {
878+
(
879+
TerminalDamage::Partial(mut lines1),
880+
TerminalDamage::Partial(lines2),
881+
) => {
879882
lines1.extend(lines2);
880883
TerminalDamage::Partial(lines1)
881884
}

frontends/rioterm/src/screen/mod.rs

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,9 +2529,10 @@ impl Screen<'_> {
25292529
// Force invalidation for search with full damage
25302530
{
25312531
let current = self.context_manager.current_mut();
2532-
current.renderable_content.pending_update.set_ui_damage(
2533-
rio_backend::event::TerminalDamage::Full
2534-
);
2532+
current
2533+
.renderable_content
2534+
.pending_update
2535+
.set_ui_damage(rio_backend::event::TerminalDamage::Full);
25352536
}
25362537
}
25372538

@@ -2740,28 +2741,32 @@ impl Screen<'_> {
27402741
if !hint_labels.is_empty() {
27412742
// Collect all lines that have hint labels
27422743
for label in hint_labels {
2743-
let line = label.position.row.0 as i32 - display_offset as i32;
2744+
let line = label.position.row.0 - display_offset as i32;
27442745
if line >= 0 && (line as usize) < screen_lines {
2745-
damaged_lines.insert(rio_backend::crosswords::LineDamage::new(
2746-
line as usize,
2747-
true,
2748-
));
2746+
damaged_lines.insert(
2747+
rio_backend::crosswords::LineDamage::new(
2748+
line as usize,
2749+
true,
2750+
),
2751+
);
27492752
}
27502753
}
27512754
}
2752-
2755+
27532756
// Also damage lines with hint matches
27542757
if let Some(hint_matches) = &current.renderable_content.hint_matches {
27552758
for hint_match in hint_matches {
2756-
let start_line = hint_match.start().row.0 as i32 - display_offset as i32;
2757-
let end_line = hint_match.end().row.0 as i32 - display_offset as i32;
2758-
2759+
let start_line = hint_match.start().row.0 - display_offset as i32;
2760+
let end_line = hint_match.end().row.0 - display_offset as i32;
2761+
27592762
for line in start_line..=end_line {
27602763
if line >= 0 && (line as usize) < screen_lines {
2761-
damaged_lines.insert(rio_backend::crosswords::LineDamage::new(
2762-
line as usize,
2763-
true,
2764-
));
2764+
damaged_lines.insert(
2765+
rio_backend::crosswords::LineDamage::new(
2766+
line as usize,
2767+
true,
2768+
),
2769+
);
27652770
}
27662771
}
27672772
}

rio-backend/src/crosswords/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,13 +489,11 @@ impl<U: EventListener> Crosswords<U> {
489489
// Only emit event if we weren't already fully damaged
490490
let was_damaged = self.damage.full;
491491
self.damage.full = true;
492-
492+
493493
// Request a render to display the damage
494494
if !was_damaged {
495-
self.event_proxy.send_event(
496-
RioEvent::RenderRoute(self.route_id),
497-
self.window_id,
498-
);
495+
self.event_proxy
496+
.send_event(RioEvent::RenderRoute(self.route_id), self.window_id);
499497
}
500498
}
501499

@@ -556,8 +554,6 @@ impl<U: EventListener> Crosswords<U> {
556554
TermDamage::Partial(TermDamageIterator::new(&self.damage.lines, display_offset))
557555
}
558556

559-
560-
561557
/// Peek damage event based on current damage state
562558
pub fn peek_damage_event(&self) -> Option<TerminalDamage> {
563559
let display_offset = self.grid.display_offset();

0 commit comments

Comments
 (0)