diff --git a/src/context.rs b/src/context.rs index 56f71983..1a8a1664 100644 --- a/src/context.rs +++ b/src/context.rs @@ -181,7 +181,7 @@ impl<'a> Context<'a> { home_dir() } - // Retrives a environment variable from the os or from a table if in testing mode + // Retrieves a environment variable from the os or from a table if in testing mode #[cfg(test)] pub fn get_env>(&self, key: K) -> Option { self.env @@ -195,7 +195,7 @@ impl<'a> Context<'a> { env::var(key.as_ref()).ok() } - // Retrives a environment variable from the os or from a table if in testing mode (os version) + // Retrieves a environment variable from the os or from a table if in testing mode (os version) #[cfg(test)] pub fn get_env_os>(&self, key: K) -> Option { self.env.get(key.as_ref()).map(OsString::from) diff --git a/src/formatter/string_formatter.rs b/src/formatter/string_formatter.rs index c680f59f..5350ff4d 100644 --- a/src/formatter/string_formatter.rs +++ b/src/formatter/string_formatter.rs @@ -447,7 +447,7 @@ where { // Handle other interpretable characters match shell { - // Bash might interepret baskslashes, backticks and $ + // Bash might interpret backslashes, backticks and $ // see #658 for more details Shell::Bash => text .into() diff --git a/src/init/mod.rs b/src/init/mod.rs index 9e30d0c4..e8afc970 100644 --- a/src/init/mod.rs +++ b/src/init/mod.rs @@ -63,7 +63,7 @@ impl StarshipPath { if e.kind() != io::ErrorKind::NotFound { log::warn!("Failed to convert \"{}\" to unix path:\n{:?}", str_path, e); } - // Failed to execute cygpath.exe means there're not inside cygwin evironment,return directly. + // Failed to execute cygpath.exe means there're not inside cygwin environment,return directly. return self.sprint(); } }; diff --git a/src/init/starship.bash b/src/init/starship.bash index 6c39e81e..04d3be96 100644 --- a/src/init/starship.bash +++ b/src/init/starship.bash @@ -38,7 +38,7 @@ starship_precmd() { fi local NUM_JOBS=0 - # Evaluate the number of jobs before running the preseved prompt command, so that tools + # Evaluate the number of jobs before running the preserved prompt command, so that tools # like z/autojump, which background certain jobs, do not cause spurious background jobs # to be displayed by starship. Also avoids forking to run `wc`, slightly improving perf. for job in $(jobs -p); do [[ $job ]] && ((NUM_JOBS++)); done diff --git a/src/modules/battery.rs b/src/modules/battery.rs index 04bc075b..1e4cc05a 100644 --- a/src/modules/battery.rs +++ b/src/modules/battery.rs @@ -87,8 +87,8 @@ fn get_battery_status(context: &Context) -> Option { /// the merge returns Charging if at least one is charging /// Discharging if at least one is Discharging -/// Full if both are Full or one is Full and the other Unknow -/// Empty if both are Empty or one is Empty and the other Unknow +/// Full if both are Full or one is Full and the other Unknown +/// Empty if both are Empty or one is Empty and the other Unknown /// Unknown otherwise fn merge_battery_states(state1: battery::State, state2: battery::State) -> battery::State { use battery::State::{Charging, Discharging, Unknown}; diff --git a/src/modules/custom.rs b/src/modules/custom.rs index 603fa818..7daea110 100644 --- a/src/modules/custom.rs +++ b/src/modules/custom.rs @@ -237,7 +237,7 @@ fn exec_command(cmd: &str, context: &Context, config: &CustomConfig) -> Option bool { let shell_exe = Path::new(shell).file_stem(); let no_args = shell_args.is_empty(); diff --git a/src/modules/docker_context.rs b/src/modules/docker_context.rs index c1a4dc69..08b72ed7 100644 --- a/src/modules/docker_context.rs +++ b/src/modules/docker_context.rs @@ -15,7 +15,7 @@ use crate::utils; /// - Or a file named `$DOCKER_CONFIG/config.json` /// - The file is JSON and contains a field named `currentContext` /// - The value of `currentContext` is not `default` -/// - If multiple criterias are met, we use the following order to define the docker context: +/// - If multiple criteria are met, we use the following order to define the docker context: /// - `DOCKER_HOST`, `DOCKER_CONTEXT`, $HOME/.docker/config.json, $`DOCKER_CONFIG/config.json` /// - (This is the same order docker follows, as `DOCKER_HOST` and `DOCKER_CONTEXT` override the /// config) diff --git a/src/modules/pulumi.rs b/src/modules/pulumi.rs index f523566d..63ef6352 100644 --- a/src/modules/pulumi.rs +++ b/src/modules/pulumi.rs @@ -92,7 +92,7 @@ fn parse_version(version: &str) -> &str { version } -/// Find a file describing a Pulumi package in the current directory (or any parrent directory). +/// Find a file describing a Pulumi package in the current directory (or any parent directory). fn find_package_file(path: &Path) -> Option { for path in path.ancestors() { log::trace!("Looking for package file in {:?}", path); diff --git a/src/modules/utils/directory_win.rs b/src/modules/utils/directory_win.rs index 4c7c9354..5033cc62 100644 --- a/src/modules/utils/directory_win.rs +++ b/src/modules/utils/directory_win.rs @@ -100,7 +100,7 @@ pub fn is_write_allowed(folder_path: &Path) -> std::result::Result GenericAll: FILE_ALL_ACCESS.0, }; - let mut priviledges: PRIVILEGE_SET = PRIVILEGE_SET::default(); + let mut privileges: PRIVILEGE_SET = PRIVILEGE_SET::default(); let mut priv_size = mem::size_of::() as _; let mut granted_access = 0; let mut access_rights = FILE_GENERIC_WRITE; @@ -112,7 +112,7 @@ pub fn is_write_allowed(folder_path: &Path) -> std::result::Result impersonated_token, access_rights.0, &mapping, - &mut priviledges, + &mut privileges, &mut priv_size, &mut granted_access, &mut result, diff --git a/src/print.rs b/src/print.rs index 0281fce4..4c3a3c2f 100644 --- a/src/print.rs +++ b/src/print.rs @@ -244,7 +244,7 @@ pub fn explain(args: Properties) { " ".repeat(max_module_width - (info.value_len)) ); for g in info.desc.graphemes(true) { - // Handle ANSI escape sequnces + // Handle ANSI escape sequences if g == "\x1B" { escaping = true; }