summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKian-Meng Ang <kianmeng.ang@gmail.com>2022-06-29 02:19:17 +0800
committerGitHub <noreply@github.com>2022-06-28 14:19:17 -0400
commit018b077630bd6eb6dc858e65c04bbfd19b40198c (patch)
tree48e8ff91177dbebded102d896f8410ea2de4a7fb
parent3538efe727e9904b799b856f385c4f977968dd49 (diff)
chore: fix typos in comments (#4122)
-rw-r--r--src/context.rs4
-rw-r--r--src/formatter/string_formatter.rs2
-rw-r--r--src/init/mod.rs2
-rw-r--r--src/init/starship.bash2
-rw-r--r--src/modules/battery.rs4
-rw-r--r--src/modules/custom.rs2
-rw-r--r--src/modules/docker_context.rs2
-rw-r--r--src/modules/pulumi.rs2
-rw-r--r--src/modules/utils/directory_win.rs4
-rw-r--r--src/print.rs2
10 files changed, 13 insertions, 13 deletions
diff --git a/src/context.rs b/src/context.rs
index 56f71983a..1a8a16644 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<K: AsRef<str>>(&self, key: K) -> Option<String> {
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<K: AsRef<str>>(&self, key: K) -> Option<OsString> {
self.env.get(key.as_ref()).map(OsString::from)
diff --git a/src/formatter/string_formatter.rs b/src/formatter/string_formatter.rs
index c680f59f2..5350ff4db 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 9e30d0c44..e8afc9704 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 6c39e81e4..04d3be96a 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 04bc075b7..1e4cc05a5 100644
--- a/src/modules/battery.rs
+++ b/src/modules/battery.rs
@@ -87,8 +87,8 @@ fn get_battery_status(context: &Context) -> Option<BatteryStatus> {
/// 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 603fa8182..7daea110f 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<S
/// If the specified shell refers to `PowerShell`, adds the arguments "-Command -" to the
/// given command.
-/// Retruns `false` if the shell shell expects scripts as arguments, `true` if as `stdin`.
+/// Returns `false` if the shell shell expects scripts as arguments, `true` if as `stdin`.
fn handle_shell(command: &mut Command, shell: &str, shell_args: &[&str]) -> 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 c1a4dc692..08b72ed70 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 f523566df..63ef63520 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<PathBuf> {
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 4c7c9354e..5033cc626 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<bool, String>
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::<PRIVILEGE_SET>() 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<bool, String>
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 0281fce4c..4c3a3c2f7 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;
}