Skip to content

Commit 5c02361

Browse files
committed
Update depts and add rusty-hook
also formatting cleanup
1 parent fb5eafc commit 5c02361

5 files changed

Lines changed: 96 additions & 8 deletions

File tree

.rusty-hook.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[hooks]
2+
pre-commit = "cargo fmt --all -- --check && cargo clippy --all-targets --all-features -- -D warnings"
3+
pre-push = "cargo test"
4+
post-commit = ""
5+
[logging]
6+
verbose = true

Cargo.lock

Lines changed: 80 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ rodio = "0.20.1"
1515
tokio = { version = "1.45.0", features = ["full"] }
1616
anyhow = "1.0.98"
1717
csv = "1.3.0"
18+
19+
20+
[dev-dependencies]
21+
rusty-hook = "0.11.2"

src/menu.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
use crate::{
2-
config::{edit_cmd_sound, edit_window_title, save_config, validate_json, CommandOption},
2+
config::{CommandOption, edit_cmd_sound, edit_window_title, save_config, validate_json},
33
csv::import_commands,
44
utils::{pause, play_sound, run_command},
55
}; // Importing functions from utils module
66
use inquire::Select;
7-
use prettytable::{row, Cell, Row, Table}; // Importing types for creating tables
7+
use prettytable::{Cell, Row, Table, row}; // Importing types for creating tables
88
use std::{
9-
io::{stdout, Write},
9+
io::{Write, stdout},
1010
path::PathBuf,
1111
process,
1212
};
1313
use termion::{clear, cursor, terminal_size};
1414
use textwrap::fill; // Importing fill function from textwrap crate // Importing IntoRawMode trait for entering raw mode
15-
// Importing Select prompt from inquire crate
15+
// Importing Select prompt from inquire crate
1616
use std::process::exit; // Importing exit function from std::process module
1717

1818
//Function for main execution to display Menu
@@ -21,7 +21,7 @@ pub async fn display_menu(config_path: &PathBuf) {
2121
// Main function to display the menu and handle user input
2222
let mut selected_commands: Vec<usize> = vec![]; // Initializing vector to hold selected commands
2323
let mut last_selected: Option<usize> = None; // Initializing variable to hold index of last selected command
24-
// Load the Config
24+
// Load the Config
2525
loop {
2626
// Checking if the config is valid or exists; editing if not
2727
let config = match crate::config::load_config(config_path) {

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rodio::{Decoder, OutputStream, Sink};
22
use std::fs::File;
3-
use std::io::{stdin, stdout, BufReader, Write};
3+
use std::io::{BufReader, Write, stdin, stdout};
44
use std::path::PathBuf;
55
use std::process::Command; // Importing Command struct for executing shell commands // Importing types for audio playback
66
use termion::{input::TermRead, raw::IntoRawMode}; // Importing IntoRawMode trait for entering raw mode

0 commit comments

Comments
 (0)