Skip to content

Commit

Permalink
chore: fix error format, clippy and rust format
Browse files Browse the repository at this point in the history
  • Loading branch information
philtweir committed Jan 19, 2025
1 parent 4bfde9d commit 25c9d49
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
5 changes: 4 additions & 1 deletion crates/atuin-client/src/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ impl KvRecord {
})
}
_ => {
bail!(t!("unknown version %{version}", version=format!("{version:?}")))
bail!(t!(
"unknown version %{version}",
version = format!("{version:?}")
))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/atuin-client/src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ impl ThemeManager {
Ok(theme) => theme,
Err(err) => {
log::warn!(
"{}: {:?}",
"{}: {}",
t!("Could not load theme %{theme}", theme = name),
err
);
Expand Down
16 changes: 8 additions & 8 deletions crates/atuin/src/command/client/search/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,13 @@ impl State {
border_size,
preview_width,
);
let show_help = settings.show_help && (!compact || f.area().height > 1);
// This is an OR, as it seems more likely for someone to wish to override
// tabs unexpectedly being missed, than unexpectedly present.
let hide_extra = settings.auto_hide_height != 0
&& compact
&& f.area().height <= settings.auto_hide_height;
let show_tabs = settings.show_tabs && !hide_extra;
let tab_col = if settings.show_tabs && !hide_extra { 1 } else { 0 };
let help_col = if settings.show_help && (!compact || f.area().height > 1) { 1 } else { 0 };
let chunks = Layout::default()
.direction(Direction::Vertical)
.margin(0)
Expand All @@ -622,21 +622,21 @@ impl State {
Constraint::Length(1 + border_size), // input
Constraint::Min(1), // results list
Constraint::Length(preview_height), // preview
Constraint::Length(if show_tabs { 1 } else { 0 }), // tabs
Constraint::Length(if show_help { 1 } else { 0 }), // header (sic)
Constraint::Length(tab_col), // tabs
Constraint::Length(help_col), // header (sic)
]
} else if hide_extra {
[
Constraint::Length(if show_help { 1 } else { 0 }), // header
Constraint::Length(help_col), // header
Constraint::Length(0), // tabs
Constraint::Min(1), // results list
Constraint::Length(0),
Constraint::Length(0),
]
} else {
[
Constraint::Length(if show_help { 1 } else { 0 }), // header
Constraint::Length(if show_tabs { 1 } else { 0 }), // tabs
Constraint::Length(help_col), // header
Constraint::Length(tab_col), // tabs
Constraint::Min(1), // results list
Constraint::Length(1 + border_size), // input
Constraint::Length(preview_height), // preview
Expand All @@ -662,7 +662,7 @@ impl State {
.map(Line::from)
.collect();

if show_tabs {
if tab_col == 1 {
let tabs = Tabs::new(titles)
.block(Block::default().borders(Borders::NONE))
.select(self.tab_index)
Expand Down

0 comments on commit 25c9d49

Please sign in to comment.