Skip to content

Commit 4d8a2a6

Browse files
committed
polish
1 parent 6e7917a commit 4d8a2a6

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

src/ui/decoder.rs

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ fn get_route(active_block: ActiveBlock) -> Route {
148148
#[cfg(test)]
149149
mod tests {
150150
use ratatui::{
151-
backend::TestBackend, layout::Position, prelude::Buffer, style::{Modifier, Style}, Terminal
151+
backend::TestBackend,
152+
layout::Position,
153+
prelude::Buffer,
154+
style::{Modifier, Style},
155+
Terminal,
152156
};
153157

154158
use super::*;
@@ -200,22 +204,29 @@ mod tests {
200204
for col in 0..=99 {
201205
match (col, row) {
202206
(1..=15, 0) => {
203-
expected.cell_mut(Position::new(col, row)).unwrap().set_style(
204-
Style::default()
205-
.fg(COLOR_YELLOW)
206-
.add_modifier(Modifier::BOLD),
207-
);
207+
expected
208+
.cell_mut(Position::new(col, row))
209+
.unwrap()
210+
.set_style(
211+
Style::default()
212+
.fg(COLOR_YELLOW)
213+
.add_modifier(Modifier::BOLD),
214+
);
208215
}
209216
(51..=82, 0) | (51..=67, 8) | (1..=20, 14) => {
210-
expected.cell_mut(Position::new(col, row)).unwrap().set_style(
211-
Style::default()
212-
.fg(COLOR_WHITE)
213-
.add_modifier(Modifier::BOLD),
214-
);
217+
expected
218+
.cell_mut(Position::new(col, row))
219+
.unwrap()
220+
.set_style(
221+
Style::default()
222+
.fg(COLOR_WHITE)
223+
.add_modifier(Modifier::BOLD),
224+
);
215225
}
216226
(0 | 16..=49, 0) | (0..=49, 13) | (0 | 49, 1..=13 | 20..=99) => {
217227
expected
218-
.cell_mut(Position::new(col, row)).unwrap()
228+
.cell_mut(Position::new(col, row))
229+
.unwrap()
219230
.set_style(Style::default().fg(COLOR_YELLOW));
220231
}
221232
(51, 1 | 4 | 9 | 11 | 13)
@@ -224,12 +235,14 @@ mod tests {
224235
| (51..=70, 10 | 12)
225236
| (52..=71, 11 | 12) => {
226237
expected
227-
.cell_mut(Position::new(col, row)).unwrap()
238+
.cell_mut(Position::new(col, row))
239+
.unwrap()
228240
.set_style(Style::default().fg(COLOR_CYAN));
229241
}
230242
_ => {
231243
expected
232-
.cell_mut(Position::new(col, row)).unwrap()
244+
.cell_mut(Position::new(col, row))
245+
.unwrap()
233246
.set_style(Style::default().fg(COLOR_WHITE));
234247
}
235248
}

0 commit comments

Comments
 (0)