From 998355f93ab34c14835a7b929daacfcbc5981b6e Mon Sep 17 00:00:00 2001 From: marcelarie Date: Tue, 29 Oct 2024 14:18:01 +0100 Subject: [PATCH] run: `cargo fmt` --- src/command/arguments.rs | 10 +++++----- src/config/alias_ignore.rs | 4 ++-- src/main.rs | 2 +- src/syntax_tree/alias.rs | 6 +++--- src/syntax_tree/mod.rs | 2 +- src/syntax_tree/nushell.rs | 4 ++-- src/syntax_tree/printer.rs | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/command/arguments.rs b/src/command/arguments.rs index d9743e1..e568382 100644 --- a/src/command/arguments.rs +++ b/src/command/arguments.rs @@ -1,16 +1,16 @@ use std::sync::OnceLock; pub struct CliArgs { - pub file_path: String, + pub file_path: String, pub output_path: String, pub no_comments: bool, } struct GatheredArgs { - file_path: Option, - output_path: String, - no_comments: bool, - arguments: Vec, + file_path: Option, + output_path: String, + no_comments: bool, + arguments: Vec, #[allow(unused)] remaining_args: Vec, } diff --git a/src/config/alias_ignore.rs b/src/config/alias_ignore.rs index 15ee69a..5f7bfd8 100644 --- a/src/config/alias_ignore.rs +++ b/src/config/alias_ignore.rs @@ -6,8 +6,8 @@ use crate::command::arguments::DEBUG_MODE_GLOBAL; /// * `alias_ignores` - A set of alias names to ignore. /// * `command_ignores` - A list of command names to ignore. pub struct AliasIgnoreResult { - pub alias_ignores: HashSet, - pub command_ignores: Vec, + pub alias_ignores: HashSet, + pub command_ignores: Vec, } /// Parses the `.aliasignore` file and returns the result. diff --git a/src/main.rs b/src/main.rs index 6afc262..c141640 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,7 +26,7 @@ fn main() { let alias_ignore_result = alias_ignore::get_ignore_set().unwrap_or_else(|| AliasIgnoreResult { - alias_ignores: HashSet::new(), + alias_ignores: HashSet::new(), command_ignores: Vec::new(), }); diff --git a/src/syntax_tree/alias.rs b/src/syntax_tree/alias.rs index be2d205..78f731b 100644 --- a/src/syntax_tree/alias.rs +++ b/src/syntax_tree/alias.rs @@ -125,10 +125,10 @@ fn extract_alias( #[derive(Debug, Clone)] pub struct Alias { - pub name: String, - pub content: String, + pub name: String, + pub content: String, pub is_valid_nushell: bool, - pub error_messages: Vec, + pub error_messages: Vec, } /// Find aliases in the given syntax tree. diff --git a/src/syntax_tree/mod.rs b/src/syntax_tree/mod.rs index 2c89a76..ee1e622 100644 --- a/src/syntax_tree/mod.rs +++ b/src/syntax_tree/mod.rs @@ -1,8 +1,8 @@ pub mod alias; pub mod nushell; pub mod printer; -pub mod traverser; pub mod process_file; +pub mod traverser; #[allow(unused)] pub use printer::print_tree; diff --git a/src/syntax_tree/nushell.rs b/src/syntax_tree/nushell.rs index 89dabd3..07483ef 100644 --- a/src/syntax_tree/nushell.rs +++ b/src/syntax_tree/nushell.rs @@ -35,7 +35,7 @@ fn create_nu_engine_state() -> EngineState { } pub struct AliasValidationResult { - pub is_valid: bool, + pub is_valid: bool, pub error_messages: Vec, } @@ -72,7 +72,7 @@ pub fn validate_alias_with_nu_parser( } } else { AliasValidationResult { - is_valid: true, + is_valid: true, error_messages: Vec::new(), } } diff --git a/src/syntax_tree/printer.rs b/src/syntax_tree/printer.rs index 0adeb8c..c7ac7eb 100644 --- a/src/syntax_tree/printer.rs +++ b/src/syntax_tree/printer.rs @@ -23,7 +23,7 @@ pub fn print_tree(cursor: &mut TreeCursor, source: &[u8], depth: usize) { indent = depth * 2 ); - // Print the node's text if it's a leaf node (no children/last node) + // Print the node's text if it's a leaf node (no children/last node) if node.child_count() == 0 { let text = &source[node.byte_range()]; if let Ok(text) = std::str::from_utf8(text) {