Skip to content

Commit cbefeb6

Browse files
committed
fix: fix clippy warnings
1 parent 567ee37 commit cbefeb6

File tree

4 files changed

+17
-33
lines changed

4 files changed

+17
-33
lines changed

Diff for: crates/atuin-daemon/src/server.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use atuin_client::encryption;
44
use atuin_client::history::store::HistoryStore;
55
use atuin_client::record::sqlite_store::SqliteStore;
66
use atuin_client::settings::Settings;
7+
#[cfg(unix)]
78
use std::path::PathBuf;
89
use std::sync::Arc;
910
use time::OffsetDateTime;

Diff for: crates/atuin/src/command/client/init.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub struct Cmd {
2626

2727
#[derive(Clone, Copy, ValueEnum, Debug)]
2828
#[value(rename_all = "lower")]
29+
#[allow(clippy::enum_variant_names, clippy::doc_markdown)]
2930
pub enum Shell {
3031
/// Zsh setup
3132
Zsh,
@@ -161,13 +162,7 @@ $env.config = (
161162
.await?;
162163
}
163164
Shell::PowerShell => {
164-
powershell::init(
165-
alias_store,
166-
var_store,
167-
self.disable_up_arrow,
168-
self.disable_ctrl_r,
169-
)
170-
.await?;
165+
powershell::init_static(self.disable_up_arrow, self.disable_ctrl_r);
171166
}
172167
}
173168

Diff for: crates/atuin/src/command/client/init/powershell.rs

+8-24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
use atuin_dotfiles::store::{var::VarStore, AliasStore};
2-
use eyre::Result;
3-
41
pub fn init_static(disable_up_arrow: bool, disable_ctrl_r: bool) {
52
let base = include_str!("../../../shell/atuin.ps1");
63

@@ -10,31 +7,18 @@ pub fn init_static(disable_up_arrow: bool, disable_ctrl_r: bool) {
107
(!disable_ctrl_r, !disable_up_arrow)
118
};
129

13-
fn bool(value: bool) -> &'static str {
14-
if value {
15-
"$true"
16-
} else {
17-
"$false"
18-
}
19-
}
20-
2110
println!("{base}");
2211
println!(
2312
"Enable-AtuinSearchKeys -CtrlR {} -UpArrow {}",
24-
bool(bind_ctrl_r),
25-
bool(bind_up_arrow)
13+
ps_bool(bind_ctrl_r),
14+
ps_bool(bind_up_arrow)
2615
);
2716
}
2817

29-
pub async fn init(
30-
_aliases: AliasStore,
31-
_vars: VarStore,
32-
disable_up_arrow: bool,
33-
disable_ctrl_r: bool,
34-
) -> Result<()> {
35-
init_static(disable_up_arrow, disable_ctrl_r);
36-
37-
// dotfiles are not supported yet
38-
39-
Ok(())
18+
fn ps_bool(value: bool) -> &'static str {
19+
if value {
20+
"$true"
21+
} else {
22+
"$false"
23+
}
4024
}

Diff for: crates/atuin/src/command/client/search/interactive.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ use ratatui::{
3333
cursor::SetCursorStyle,
3434
event::{
3535
self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent, KeyModifiers,
36-
KeyboardEnhancementFlags, MouseEvent, PopKeyboardEnhancementFlags,
37-
PushKeyboardEnhancementFlags,
36+
MouseEvent,
3837
},
3938
execute, terminal,
4039
},
@@ -46,6 +45,11 @@ use ratatui::{
4645
Frame, Terminal, TerminalOptions, Viewport,
4746
};
4847

48+
#[cfg(not(target_os = "windows"))]
49+
use ratatui::crossterm::event::{
50+
KeyboardEnhancementFlags, PopKeyboardEnhancementFlags, PushKeyboardEnhancementFlags,
51+
};
52+
4953
const TAB_TITLES: [&str; 2] = ["Search", "Inspect"];
5054

5155
pub enum InputAction {

0 commit comments

Comments
 (0)