Skip to content

Commit 2d9984f

Browse files
committed
just fmt
1 parent 8d595de commit 2d9984f

4 files changed

Lines changed: 10 additions & 12 deletions

File tree

src/input.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ pub fn key_to_message(key: KeyEvent) -> Option<Message> {
66
match key.code {
77
KeyCode::Char('q') | KeyCode::Esc => Some(Message::Quit),
88

9-
KeyCode::Right | KeyCode::Char('l' | ' ') | KeyCode::PageDown => {
10-
Some(Message::NextPage)
11-
}
9+
KeyCode::Right | KeyCode::Char('l' | ' ') | KeyCode::PageDown => Some(Message::NextPage),
1210
KeyCode::Left | KeyCode::Char('h') | KeyCode::PageUp => Some(Message::PrevPage),
1311

1412
KeyCode::Char('g') | KeyCode::Home => Some(Message::FirstPage),

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
5454
return update::self_update();
5555
}
5656

57-
let path = cli.path.ok_or("usage: tpdf <file.pdf>\n tpdf update")?;
57+
let path = cli
58+
.path
59+
.ok_or("usage: tpdf <file.pdf>\n tpdf update")?;
5860

5961
let config = AppConfig {
6062
dark_mode: cli.night,

src/update.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ fn platform_name() -> Result<String, Box<dyn std::error::Error>> {
2626

2727
fn fetch_latest_tag() -> Result<String, Box<dyn std::error::Error>> {
2828
let url = format!("https://api.github.com/repos/{REPO}/releases/latest");
29-
let output = Command::new("curl")
30-
.args(["-fsSL", &url])
31-
.output()?;
29+
let output = Command::new("curl").args(["-fsSL", &url]).output()?;
3230

3331
if !output.status.success() {
3432
return Err("Failed to fetch release info from GitHub".into());

src/view.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ pub fn draw(frame: &mut Frame, app: &mut App) {
3030
} else {
3131
Color::Rgb(255, 255, 255)
3232
};
33-
frame.render_widget(Block::default().style(Style::default().bg(bg)), content_area);
33+
frame.render_widget(
34+
Block::default().style(Style::default().bg(bg)),
35+
content_area,
36+
);
3437

3538
match app.layout {
3639
PageLayout::Single => {
@@ -176,10 +179,7 @@ fn draw_status_bar(frame: &mut Frame, area: Rect, app: &App) {
176179
let info = info_parts.join(" | ");
177180
let keys = "h/l:page jk:pan +/-:zoom d:layout f:full p:goto n:night q:quit ";
178181

179-
let left_parts = vec![
180-
Span::styled(" tpdf", bold),
181-
Span::raw(format!(" | {info}")),
182-
];
182+
let left_parts = vec![Span::styled(" tpdf", bold), Span::raw(format!(" | {info}"))];
183183
let left_len = 5 + 3 + info.len();
184184
let gap = (area.width as usize).saturating_sub(left_len + keys.len());
185185

0 commit comments

Comments
 (0)