style: use 'Self' to refer to own type (clippy::use_self) (#6735)

---------

Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
This commit is contained in:
danieleades
2025-06-22 14:38:27 +01:00
committed by GitHub
parent 5bf25b77a4
commit 6122516887
101 changed files with 120 additions and 117 deletions
+3
View File
@@ -134,3 +134,6 @@ strip = false
[[bin]] [[bin]]
name = "starship" name = "starship"
path = "src/main.rs" path = "src/main.rs"
[lints.clippy]
use_self = "warn"
+1 -1
View File
@@ -51,7 +51,7 @@ pub struct AwsConfig<'a> {
impl Default for AwsConfig<'_> { impl Default for AwsConfig<'_> {
fn default() -> Self { fn default() -> Self {
AwsConfig { Self {
format: "on [$symbol($profile )(\\($region\\) )(\\[$duration\\] )]($style)", format: "on [$symbol($profile )(\\($region\\) )(\\[$duration\\] )]($style)",
symbol: "☁️ ", symbol: "☁️ ",
style: "bold yellow", style: "bold yellow",
+1 -1
View File
@@ -18,7 +18,7 @@ pub struct AzureConfig<'a> {
impl Default for AzureConfig<'_> { impl Default for AzureConfig<'_> {
fn default() -> Self { fn default() -> Self {
AzureConfig { Self {
format: "on [$symbol($subscription)]($style) ", format: "on [$symbol($subscription)]($style) ",
symbol: "󰠅 ", symbol: "󰠅 ",
style: "blue bold", style: "blue bold",
+2 -2
View File
@@ -21,7 +21,7 @@ pub struct BatteryConfig<'a> {
impl Default for BatteryConfig<'_> { impl Default for BatteryConfig<'_> {
fn default() -> Self { fn default() -> Self {
BatteryConfig { Self {
full_symbol: "󰁹 ", full_symbol: "󰁹 ",
charging_symbol: "󰂄 ", charging_symbol: "󰂄 ",
discharging_symbol: "󰂃 ", discharging_symbol: "󰂃 ",
@@ -50,7 +50,7 @@ pub struct BatteryDisplayConfig<'a> {
impl Default for BatteryDisplayConfig<'_> { impl Default for BatteryDisplayConfig<'_> {
fn default() -> Self { fn default() -> Self {
BatteryDisplayConfig { Self {
threshold: 10, threshold: 10,
style: "red bold", style: "red bold",
charging_symbol: None, charging_symbol: None,
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct BufConfig<'a> {
impl Default for BufConfig<'_> { impl Default for BufConfig<'_> {
fn default() -> Self { fn default() -> Self {
BufConfig { Self {
format: "with [$symbol($version )]($style)", format: "with [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🐃 ", symbol: "🐃 ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct BunConfig<'a> {
impl Default for BunConfig<'_> { impl Default for BunConfig<'_> {
fn default() -> Self { fn default() -> Self {
BunConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🥟 ", symbol: "🥟 ",
+1 -1
View File
@@ -13,7 +13,7 @@ pub type CConfig<'a> = CcConfig<'a, CConfigMarker>;
impl Default for CConfig<'_> { impl Default for CConfig<'_> {
fn default() -> Self { fn default() -> Self {
CcConfig { Self {
marker: std::marker::PhantomData::<CConfigMarker>, marker: std::marker::PhantomData::<CConfigMarker>,
format: "via [$symbol($version(-$name) )]($style)", format: "via [$symbol($version(-$name) )]($style)",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct CharacterConfig<'a> {
impl Default for CharacterConfig<'_> { impl Default for CharacterConfig<'_> {
fn default() -> Self { fn default() -> Self {
CharacterConfig { Self {
format: "$symbol ", format: "$symbol ",
success_symbol: "[](bold green)", success_symbol: "[](bold green)",
error_symbol: "[](bold red)", error_symbol: "[](bold red)",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct CMakeConfig<'a> {
impl Default for CMakeConfig<'_> { impl Default for CMakeConfig<'_> {
fn default() -> Self { fn default() -> Self {
CMakeConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+1 -1
View File
@@ -22,7 +22,7 @@ pub struct CmdDurationConfig<'a> {
impl Default for CmdDurationConfig<'_> { impl Default for CmdDurationConfig<'_> {
fn default() -> Self { fn default() -> Self {
CmdDurationConfig { Self {
min_time: 2_000, min_time: 2_000,
format: "took [$duration]($style) ", format: "took [$duration]($style) ",
show_milliseconds: false, show_milliseconds: false,
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct CobolConfig<'a> {
impl Default for CobolConfig<'_> { impl Default for CobolConfig<'_> {
fn default() -> Self { fn default() -> Self {
CobolConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "⚙️ ", symbol: "⚙️ ",
+1 -1
View File
@@ -19,7 +19,7 @@ pub struct CondaConfig<'a> {
impl Default for CondaConfig<'_> { impl Default for CondaConfig<'_> {
fn default() -> Self { fn default() -> Self {
CondaConfig { Self {
truncation_length: 1, truncation_length: 1,
format: "via [$symbol$environment]($style) ", format: "via [$symbol$environment]($style) ",
symbol: "🅒 ", symbol: "🅒 ",
+1 -1
View File
@@ -16,7 +16,7 @@ pub struct ContainerConfig<'a> {
impl Default for ContainerConfig<'_> { impl Default for ContainerConfig<'_> {
fn default() -> Self { fn default() -> Self {
ContainerConfig { Self {
format: "[$symbol \\[$name\\]]($style) ", format: "[$symbol \\[$name\\]]($style) ",
symbol: "", symbol: "",
style: "red bold dimmed", style: "red bold dimmed",
+1 -1
View File
@@ -13,7 +13,7 @@ pub type CppConfig<'a> = CcConfig<'a, CppConfigMarker>;
impl Default for CppConfig<'_> { impl Default for CppConfig<'_> {
fn default() -> Self { fn default() -> Self {
CcConfig { Self {
marker: std::marker::PhantomData::<CppConfigMarker>, marker: std::marker::PhantomData::<CppConfigMarker>,
format: "via [$symbol($version(-$name) )]($style)", format: "via [$symbol($version(-$name) )]($style)",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct CrystalConfig<'a> {
impl Default for CrystalConfig<'_> { impl Default for CrystalConfig<'_> {
fn default() -> Self { fn default() -> Self {
CrystalConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🔮 ", symbol: "🔮 ",
+1 -1
View File
@@ -35,7 +35,7 @@ pub struct CustomConfig<'a> {
impl Default for CustomConfig<'_> { impl Default for CustomConfig<'_> {
fn default() -> Self { fn default() -> Self {
CustomConfig { Self {
format: "[$symbol($output )]($style)", format: "[$symbol($output )]($style)",
symbol: "", symbol: "",
command: "", command: "",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct DamlConfig<'a> {
impl Default for DamlConfig<'_> { impl Default for DamlConfig<'_> {
fn default() -> Self { fn default() -> Self {
DamlConfig { Self {
symbol: "Λ ", symbol: "Λ ",
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct DartConfig<'a> {
impl Default for DartConfig<'_> { impl Default for DartConfig<'_> {
fn default() -> Self { fn default() -> Self {
DartConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🎯 ", symbol: "🎯 ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct DenoConfig<'a> {
impl Default for DenoConfig<'_> { impl Default for DenoConfig<'_> {
fn default() -> Self { fn default() -> Self {
DenoConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🦕 ", symbol: "🦕 ",
+1 -1
View File
@@ -30,7 +30,7 @@ pub struct DirectoryConfig<'a> {
impl Default for DirectoryConfig<'_> { impl Default for DirectoryConfig<'_> {
fn default() -> Self { fn default() -> Self {
DirectoryConfig { Self {
truncation_length: 3, truncation_length: 3,
truncate_to_repo: true, truncate_to_repo: true,
fish_style_pwd_dir_length: 0, fish_style_pwd_dir_length: 0,
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct DockerContextConfig<'a> {
impl Default for DockerContextConfig<'_> { impl Default for DockerContextConfig<'_> {
fn default() -> Self { fn default() -> Self {
DockerContextConfig { Self {
symbol: "🐳 ", symbol: "🐳 ",
style: "blue bold", style: "blue bold",
format: "via [$symbol$context]($style) ", format: "via [$symbol$context]($style) ",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct DotnetConfig<'a> {
impl Default for DotnetConfig<'_> { impl Default for DotnetConfig<'_> {
fn default() -> Self { fn default() -> Self {
DotnetConfig { Self {
format: "via [$symbol($version )(🎯 $tfm )]($style)", format: "via [$symbol($version )(🎯 $tfm )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: ".NET ", symbol: ".NET ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct ElixirConfig<'a> {
impl Default for ElixirConfig<'_> { impl Default for ElixirConfig<'_> {
fn default() -> Self { fn default() -> Self {
ElixirConfig { Self {
format: "via [$symbol($version \\(OTP $otp_version\\) )]($style)", format: "via [$symbol($version \\(OTP $otp_version\\) )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "💧 ", symbol: "💧 ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct ElmConfig<'a> {
impl Default for ElmConfig<'_> { impl Default for ElmConfig<'_> {
fn default() -> Self { fn default() -> Self {
ElmConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🌳 ", symbol: "🌳 ",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct EnvVarConfig<'a> {
impl Default for EnvVarConfig<'_> { impl Default for EnvVarConfig<'_> {
fn default() -> Self { fn default() -> Self {
EnvVarConfig { Self {
symbol: "", symbol: "",
style: "black bold dimmed", style: "black bold dimmed",
variable: None, variable: None,
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct ErlangConfig<'a> {
impl Default for ErlangConfig<'_> { impl Default for ErlangConfig<'_> {
fn default() -> Self { fn default() -> Self {
ErlangConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct FennelConfig<'a> {
impl Default for FennelConfig<'_> { impl Default for FennelConfig<'_> {
fn default() -> Self { fn default() -> Self {
FennelConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🧅 ", symbol: "🧅 ",
+1 -1
View File
@@ -15,7 +15,7 @@ pub struct FillConfig<'a> {
impl Default for FillConfig<'_> { impl Default for FillConfig<'_> {
fn default() -> Self { fn default() -> Self {
FillConfig { Self {
style: "bold black", style: "bold black",
symbol: ".", symbol: ".",
disabled: false, disabled: false,
+1 -1
View File
@@ -18,7 +18,7 @@ pub struct FossilBranchConfig<'a> {
impl Default for FossilBranchConfig<'_> { impl Default for FossilBranchConfig<'_> {
fn default() -> Self { fn default() -> Self {
FossilBranchConfig { Self {
format: "on [$symbol$branch]($style) ", format: "on [$symbol$branch]($style) ",
symbol: "", symbol: "",
style: "bold purple", style: "bold purple",
+1 -1
View File
@@ -17,7 +17,7 @@ pub struct FossilMetricsConfig<'a> {
impl Default for FossilMetricsConfig<'_> { impl Default for FossilMetricsConfig<'_> {
fn default() -> Self { fn default() -> Self {
FossilMetricsConfig { Self {
format: "([+$added]($added_style) )([-$deleted]($deleted_style) )", format: "([+$added]($added_style) )([-$deleted]($deleted_style) )",
added_style: "bold green", added_style: "bold green",
deleted_style: "bold red", deleted_style: "bold red",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct GcloudConfig<'a> {
impl Default for GcloudConfig<'_> { impl Default for GcloudConfig<'_> {
fn default() -> Self { fn default() -> Self {
GcloudConfig { Self {
format: "on [$symbol$account(@$domain)(\\($region\\))]($style) ", format: "on [$symbol$account(@$domain)(\\($region\\))]($style) ",
symbol: "☁️ ", symbol: "☁️ ",
style: "bold blue", style: "bold blue",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct GitBranchConfig<'a> {
impl Default for GitBranchConfig<'_> { impl Default for GitBranchConfig<'_> {
fn default() -> Self { fn default() -> Self {
GitBranchConfig { Self {
format: "on [$symbol$branch(:$remote_branch)]($style) ", format: "on [$symbol$branch(:$remote_branch)]($style) ",
symbol: "", symbol: "",
style: "bold purple", style: "bold purple",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct GitCommitConfig<'a> {
impl Default for GitCommitConfig<'_> { impl Default for GitCommitConfig<'_> {
fn default() -> Self { fn default() -> Self {
GitCommitConfig { Self {
// be consistent with git by default, which has DEFAULT_ABBREV set to 7 // be consistent with git by default, which has DEFAULT_ABBREV set to 7
commit_hash_length: 7, commit_hash_length: 7,
format: "[\\($hash$tag\\)]($style) ", format: "[\\($hash$tag\\)]($style) ",
+1 -1
View File
@@ -18,7 +18,7 @@ pub struct GitMetricsConfig<'a> {
impl Default for GitMetricsConfig<'_> { impl Default for GitMetricsConfig<'_> {
fn default() -> Self { fn default() -> Self {
GitMetricsConfig { Self {
added_style: "bold green", added_style: "bold green",
deleted_style: "bold red", deleted_style: "bold red",
only_nonzero_diffs: true, only_nonzero_diffs: true,
+1 -1
View File
@@ -22,7 +22,7 @@ pub struct GitStateConfig<'a> {
impl Default for GitStateConfig<'_> { impl Default for GitStateConfig<'_> {
fn default() -> Self { fn default() -> Self {
GitStateConfig { Self {
rebase: "REBASING", rebase: "REBASING",
merge: "MERGING", merge: "MERGING",
revert: "REVERTING", revert: "REVERTING",
+1 -1
View File
@@ -31,7 +31,7 @@ pub struct GitStatusConfig<'a> {
impl Default for GitStatusConfig<'_> { impl Default for GitStatusConfig<'_> {
fn default() -> Self { fn default() -> Self {
GitStatusConfig { Self {
format: "([\\[$all_status$ahead_behind\\]]($style) )", format: "([\\[$all_status$ahead_behind\\]]($style) )",
style: "red bold", style: "red bold",
stashed: "\\$", stashed: "\\$",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct GleamConfig<'a> {
impl Default for GleamConfig<'_> { impl Default for GleamConfig<'_> {
fn default() -> Self { fn default() -> Self {
GleamConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct GoConfig<'a> {
impl Default for GoConfig<'_> { impl Default for GoConfig<'_> {
fn default() -> Self { fn default() -> Self {
GoConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🐹 ", symbol: "🐹 ",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct GradleConfig<'a> {
impl Default for GradleConfig<'_> { impl Default for GradleConfig<'_> {
fn default() -> Self { fn default() -> Self {
GradleConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🅶 ", symbol: "🅶 ",
+1 -1
View File
@@ -16,7 +16,7 @@ pub struct GuixShellConfig<'a> {
impl Default for GuixShellConfig<'_> { impl Default for GuixShellConfig<'_> {
fn default() -> Self { fn default() -> Self {
GuixShellConfig { Self {
format: "via [$symbol]($style) ", format: "via [$symbol]($style) ",
symbol: "🐃 ", symbol: "🐃 ",
style: "yellow bold", style: "yellow bold",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct HaskellConfig<'a> {
impl Default for HaskellConfig<'_> { impl Default for HaskellConfig<'_> {
fn default() -> Self { fn default() -> Self {
HaskellConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "λ ", symbol: "λ ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct HaxeConfig<'a> {
impl Default for HaxeConfig<'_> { impl Default for HaxeConfig<'_> {
fn default() -> Self { fn default() -> Self {
HaxeConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct HelmConfig<'a> {
impl Default for HelmConfig<'_> { impl Default for HelmConfig<'_> {
fn default() -> Self { fn default() -> Self {
HelmConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+1 -1
View File
@@ -18,7 +18,7 @@ pub struct HgBranchConfig<'a> {
impl Default for HgBranchConfig<'_> { impl Default for HgBranchConfig<'_> {
fn default() -> Self { fn default() -> Self {
HgBranchConfig { Self {
symbol: "", symbol: "",
style: "bold purple", style: "bold purple",
format: "on [$symbol$branch(:$topic)]($style) ", format: "on [$symbol$branch(:$topic)]($style) ",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct HostnameConfig<'a> {
impl Default for HostnameConfig<'_> { impl Default for HostnameConfig<'_> {
fn default() -> Self { fn default() -> Self {
HostnameConfig { Self {
ssh_only: true, ssh_only: true,
ssh_symbol: "🌐 ", ssh_symbol: "🌐 ",
trim_at: ".", trim_at: ".",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct JavaConfig<'a> {
impl Default for JavaConfig<'_> { impl Default for JavaConfig<'_> {
fn default() -> Self { fn default() -> Self {
JavaConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
disabled: false, disabled: false,
+1 -1
View File
@@ -19,7 +19,7 @@ pub struct JobsConfig<'a> {
impl Default for JobsConfig<'_> { impl Default for JobsConfig<'_> {
fn default() -> Self { fn default() -> Self {
JobsConfig { Self {
threshold: 1, threshold: 1,
symbol_threshold: 1, symbol_threshold: 1,
number_threshold: 2, number_threshold: 2,
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct JuliaConfig<'a> {
impl Default for JuliaConfig<'_> { impl Default for JuliaConfig<'_> {
fn default() -> Self { fn default() -> Self {
JuliaConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct KotlinConfig<'a> {
impl Default for KotlinConfig<'_> { impl Default for KotlinConfig<'_> {
fn default() -> Self { fn default() -> Self {
KotlinConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🅺 ", symbol: "🅺 ",
+1 -1
View File
@@ -24,7 +24,7 @@ pub struct KubernetesConfig<'a> {
impl Default for KubernetesConfig<'_> { impl Default for KubernetesConfig<'_> {
fn default() -> Self { fn default() -> Self {
KubernetesConfig { Self {
symbol: "", symbol: "",
format: "[$symbol$context( \\($namespace\\))]($style) in ", format: "[$symbol$context( \\($namespace\\))]($style) in ",
style: "cyan bold", style: "cyan bold",
+1 -1
View File
@@ -16,7 +16,7 @@ pub struct LocalipConfig<'a> {
impl Default for LocalipConfig<'_> { impl Default for LocalipConfig<'_> {
fn default() -> Self { fn default() -> Self {
LocalipConfig { Self {
ssh_only: true, ssh_only: true,
format: "[$localipv4]($style) ", format: "[$localipv4]($style) ",
style: "yellow bold", style: "yellow bold",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct LuaConfig<'a> {
impl Default for LuaConfig<'_> { impl Default for LuaConfig<'_> {
fn default() -> Self { fn default() -> Self {
LuaConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🌙 ", symbol: "🌙 ",
+1 -1
View File
@@ -17,7 +17,7 @@ pub struct MemoryConfig<'a> {
impl Default for MemoryConfig<'_> { impl Default for MemoryConfig<'_> {
fn default() -> Self { fn default() -> Self {
MemoryConfig { Self {
threshold: 75, threshold: 75,
format: "via $symbol[$ram( | $swap)]($style) ", format: "via $symbol[$ram( | $swap)]($style) ",
style: "white bold dimmed", style: "white bold dimmed",
+1 -1
View File
@@ -18,7 +18,7 @@ pub struct MesonConfig<'a> {
impl Default for MesonConfig<'_> { impl Default for MesonConfig<'_> {
fn default() -> Self { fn default() -> Self {
MesonConfig { Self {
truncation_length: u32::MAX, truncation_length: u32::MAX,
truncation_symbol: "", truncation_symbol: "",
format: "via [$symbol$project]($style) ", format: "via [$symbol$project]($style) ",
+1 -1
View File
@@ -22,7 +22,7 @@ pub struct MojoConfig<'a> {
impl Default for MojoConfig<'_> { impl Default for MojoConfig<'_> {
fn default() -> Self { fn default() -> Self {
MojoConfig { Self {
format: "with [$symbol($version )]($style)", format: "with [$symbol($version )]($style)",
symbol: "🔥 ", symbol: "🔥 ",
style: "bold 208", style: "bold 208",
+1 -1
View File
@@ -16,7 +16,7 @@ pub struct NatsConfig<'a> {
impl Default for NatsConfig<'_> { impl Default for NatsConfig<'_> {
fn default() -> Self { fn default() -> Self {
NatsConfig { Self {
format: "[$symbol($name )]($style)", format: "[$symbol($name )]($style)",
symbol: "✉️ ", symbol: "✉️ ",
style: "bold purple", style: "bold purple",
+1 -1
View File
@@ -16,7 +16,7 @@ pub struct NetnsConfig<'a> {
impl Default for NetnsConfig<'_> { impl Default for NetnsConfig<'_> {
fn default() -> Self { fn default() -> Self {
NetnsConfig { Self {
format: "[$symbol \\[$name\\]]($style) ", format: "[$symbol \\[$name\\]]($style) ",
symbol: "🛜", symbol: "🛜",
style: "blue bold dimmed", style: "blue bold dimmed",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct NimConfig<'a> {
impl Default for NimConfig<'_> { impl Default for NimConfig<'_> {
fn default() -> Self { fn default() -> Self {
NimConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "👑 ", symbol: "👑 ",
+1 -1
View File
@@ -23,7 +23,7 @@ multiwidth emoji support in some shells. Please do not file a PR to change this
unless you can show that your changes do not affect this workaround. */ unless you can show that your changes do not affect this workaround. */
impl Default for NixShellConfig<'_> { impl Default for NixShellConfig<'_> {
fn default() -> Self { fn default() -> Self {
NixShellConfig { Self {
format: "via [$symbol$state( \\($name\\))]($style) ", format: "via [$symbol$state( \\($name\\))]($style) ",
symbol: "❄️ ", symbol: "❄️ ",
style: "bold blue", style: "bold blue",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct NodejsConfig<'a> {
impl Default for NodejsConfig<'_> { impl Default for NodejsConfig<'_> {
fn default() -> Self { fn default() -> Self {
NodejsConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+1 -1
View File
@@ -22,7 +22,7 @@ pub struct OCamlConfig<'a> {
impl Default for OCamlConfig<'_> { impl Default for OCamlConfig<'_> {
fn default() -> Self { fn default() -> Self {
OCamlConfig { Self {
format: "via [$symbol($version )(\\($switch_indicator$switch_name\\) )]($style)", format: "via [$symbol($version )(\\($switch_indicator$switch_name\\) )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
global_switch_indicator: "", global_switch_indicator: "",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct OdinConfig<'a> {
impl Default for OdinConfig<'_> { impl Default for OdinConfig<'_> {
fn default() -> Self { fn default() -> Self {
OdinConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
show_commit: false, show_commit: false,
symbol: "Ø ", symbol: "Ø ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct OpaConfig<'a> {
impl Default for OpaConfig<'_> { impl Default for OpaConfig<'_> {
fn default() -> Self { fn default() -> Self {
OpaConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🪖 ", symbol: "🪖 ",
+1 -1
View File
@@ -16,7 +16,7 @@ pub struct OspConfig<'a> {
impl Default for OspConfig<'_> { impl Default for OspConfig<'_> {
fn default() -> Self { fn default() -> Self {
OspConfig { Self {
format: "on [$symbol$cloud(\\($project\\))]($style) ", format: "on [$symbol$cloud(\\($project\\))]($style) ",
symbol: "☁️ ", symbol: "☁️ ",
style: "bold yellow", style: "bold yellow",
+1 -1
View File
@@ -24,7 +24,7 @@ impl<'a> OSConfig<'a> {
impl Default for OSConfig<'_> { impl Default for OSConfig<'_> {
fn default() -> Self { fn default() -> Self {
OSConfig { Self {
format: "[$symbol]($style)", format: "[$symbol]($style)",
style: "bold white", style: "bold white",
symbols: indexmap! { symbols: indexmap! {
+1 -1
View File
@@ -18,7 +18,7 @@ pub struct PackageConfig<'a> {
impl Default for PackageConfig<'_> { impl Default for PackageConfig<'_> {
fn default() -> Self { fn default() -> Self {
PackageConfig { Self {
format: "is [$symbol$version]($style) ", format: "is [$symbol$version]($style) ",
symbol: "📦 ", symbol: "📦 ",
style: "208 bold", style: "208 bold",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct PerlConfig<'a> {
impl Default for PerlConfig<'_> { impl Default for PerlConfig<'_> {
fn default() -> Self { fn default() -> Self {
PerlConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🐪 ", symbol: "🐪 ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct PhpConfig<'a> {
impl Default for PhpConfig<'_> { impl Default for PhpConfig<'_> {
fn default() -> Self { fn default() -> Self {
PhpConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🐘 ", symbol: "🐘 ",
+1 -1
View File
@@ -18,7 +18,7 @@ pub struct PijulConfig<'a> {
impl Default for PijulConfig<'_> { impl Default for PijulConfig<'_> {
fn default() -> Self { fn default() -> Self {
PijulConfig { Self {
symbol: "", symbol: "",
style: "bold purple", style: "bold purple",
format: "on [$symbol$channel]($style) ", format: "on [$symbol$channel]($style) ",
+1 -1
View File
@@ -24,7 +24,7 @@ pub struct PixiConfig<'a> {
impl Default for PixiConfig<'_> { impl Default for PixiConfig<'_> {
fn default() -> Self { fn default() -> Self {
PixiConfig { Self {
pixi_binary: VecOr(vec!["pixi"]), pixi_binary: VecOr(vec!["pixi"]),
show_default_environment: true, show_default_environment: true,
format: "via [$symbol($version )(\\($environment\\) )]($style)", format: "via [$symbol($version )(\\($environment\\) )]($style)",
+1 -1
View File
@@ -18,7 +18,7 @@ pub struct PulumiConfig<'a> {
impl Default for PulumiConfig<'_> { impl Default for PulumiConfig<'_> {
fn default() -> Self { fn default() -> Self {
PulumiConfig { Self {
format: "via [$symbol($username@)$stack]($style) ", format: "via [$symbol($username@)$stack]($style) ",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct PureScriptConfig<'a> {
impl Default for PureScriptConfig<'_> { impl Default for PureScriptConfig<'_> {
fn default() -> Self { fn default() -> Self {
PureScriptConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "<=> ", symbol: "<=> ",
+1 -1
View File
@@ -26,7 +26,7 @@ pub struct PythonConfig<'a> {
impl Default for PythonConfig<'_> { impl Default for PythonConfig<'_> {
fn default() -> Self { fn default() -> Self {
PythonConfig { Self {
pyenv_version_name: false, pyenv_version_name: false,
pyenv_prefix: "pyenv ", pyenv_prefix: "pyenv ",
python_binary: VecOr(vec![ python_binary: VecOr(vec![
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct QuartoConfig<'a> {
impl Default for QuartoConfig<'_> { impl Default for QuartoConfig<'_> {
fn default() -> Self { fn default() -> Self {
QuartoConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct RedConfig<'a> {
impl Default for RedConfig<'_> { impl Default for RedConfig<'_> {
fn default() -> Self { fn default() -> Self {
RedConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🔺 ", symbol: "🔺 ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct RLangConfig<'a> {
impl Default for RLangConfig<'_> { impl Default for RLangConfig<'_> {
fn default() -> Self { fn default() -> Self {
RLangConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
style: "blue bold", style: "blue bold",
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct RubyConfig<'a> {
impl Default for RubyConfig<'_> { impl Default for RubyConfig<'_> {
fn default() -> Self { fn default() -> Self {
RubyConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "💎 ", symbol: "💎 ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct RustConfig<'a> {
impl Default for RustConfig<'_> { impl Default for RustConfig<'_> {
fn default() -> Self { fn default() -> Self {
RustConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🦀 ", symbol: "🦀 ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct ScalaConfig<'a> {
impl Default for ScalaConfig<'_> { impl Default for ScalaConfig<'_> {
fn default() -> Self { fn default() -> Self {
ScalaConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
disabled: false, disabled: false,
+1 -1
View File
@@ -28,7 +28,7 @@ pub struct ShellConfig<'a> {
impl Default for ShellConfig<'_> { impl Default for ShellConfig<'_> {
fn default() -> Self { fn default() -> Self {
ShellConfig { Self {
format: "[$indicator]($style) ", format: "[$indicator]($style) ",
bash_indicator: "bsh", bash_indicator: "bsh",
fish_indicator: "fsh", fish_indicator: "fsh",
+1 -1
View File
@@ -19,7 +19,7 @@ pub struct ShLvlConfig<'a> {
impl Default for ShLvlConfig<'_> { impl Default for ShLvlConfig<'_> {
fn default() -> Self { fn default() -> Self {
ShLvlConfig { Self {
threshold: 2, threshold: 2,
format: "[$symbol$shlvl]($style) ", format: "[$symbol$shlvl]($style) ",
symbol: "↕️ ", // extra space for emoji symbol: "↕️ ", // extra space for emoji
+1 -1
View File
@@ -16,7 +16,7 @@ pub struct SingularityConfig<'a> {
impl Default for SingularityConfig<'_> { impl Default for SingularityConfig<'_> {
fn default() -> Self { fn default() -> Self {
SingularityConfig { Self {
format: "[$symbol\\[$env\\]]($style) ", format: "[$symbol\\[$env\\]]($style) ",
symbol: "", symbol: "",
style: "blue bold dimmed", style: "blue bold dimmed",
+1 -1
View File
@@ -23,7 +23,7 @@ pub struct SolidityConfig<'a> {
impl Default for SolidityConfig<'_> { impl Default for SolidityConfig<'_> {
fn default() -> Self { fn default() -> Self {
SolidityConfig { Self {
format: "via [$symbol($version)]($style)", format: "via [$symbol($version)]($style)",
symbol: "S ", symbol: "S ",
style: "bold blue", style: "bold blue",
+1 -1
View File
@@ -17,7 +17,7 @@ pub struct SpackConfig<'a> {
impl Default for SpackConfig<'_> { impl Default for SpackConfig<'_> {
fn default() -> Self { fn default() -> Self {
SpackConfig { Self {
truncation_length: 1, truncation_length: 1,
format: "via [$symbol$environment]($style) ", format: "via [$symbol$environment]($style) ",
symbol: "🅢 ", symbol: "🅢 ",
+1 -1
View File
@@ -32,7 +32,7 @@ pub struct StatusConfig<'a> {
impl Default for StatusConfig<'_> { impl Default for StatusConfig<'_> {
fn default() -> Self { fn default() -> Self {
StatusConfig { Self {
format: "[$symbol$status]($style) ", format: "[$symbol$status]($style) ",
symbol: "", symbol: "",
success_symbol: "", success_symbol: "",
+1 -1
View File
@@ -17,7 +17,7 @@ pub struct SudoConfig<'a> {
impl Default for SudoConfig<'_> { impl Default for SudoConfig<'_> {
fn default() -> Self { fn default() -> Self {
SudoConfig { Self {
format: "[as $symbol]($style)", format: "[as $symbol]($style)",
symbol: "🧙 ", symbol: "🧙 ",
style: "bold blue", style: "bold blue",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct SwiftConfig<'a> {
impl Default for SwiftConfig<'_> { impl Default for SwiftConfig<'_> {
fn default() -> Self { fn default() -> Self {
SwiftConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "🐦 ", symbol: "🐦 ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct TerraformConfig<'a> {
impl Default for TerraformConfig<'_> { impl Default for TerraformConfig<'_> {
fn default() -> Self { fn default() -> Self {
TerraformConfig { Self {
format: "via [$symbol$workspace]($style) ", format: "via [$symbol$workspace]($style) ",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "💠 ", symbol: "💠 ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct TimeConfig<'a> {
impl Default for TimeConfig<'_> { impl Default for TimeConfig<'_> {
fn default() -> Self { fn default() -> Self {
TimeConfig { Self {
format: "at [$time]($style) ", format: "at [$time]($style) ",
style: "bold yellow", style: "bold yellow",
use_12hr: false, use_12hr: false,
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct TypstConfig<'a> {
impl Default for TypstConfig<'_> { impl Default for TypstConfig<'_> {
fn default() -> Self { fn default() -> Self {
TypstConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "t ", symbol: "t ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct UsernameConfig<'a> {
impl Default for UsernameConfig<'_> { impl Default for UsernameConfig<'_> {
fn default() -> Self { fn default() -> Self {
UsernameConfig { Self {
detect_env_vars: vec![], detect_env_vars: vec![],
format: "[$user]($style) in ", format: "[$user]($style) in ",
style_root: "red bold", style_root: "red bold",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct VConfig<'a> {
impl Default for VConfig<'_> { impl Default for VConfig<'_> {
fn default() -> Self { fn default() -> Self {
VConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "V ", symbol: "V ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct VagrantConfig<'a> {
impl Default for VagrantConfig<'_> { impl Default for VagrantConfig<'_> {
fn default() -> Self { fn default() -> Self {
VagrantConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+1 -1
View File
@@ -16,7 +16,7 @@ pub struct VcshConfig<'a> {
impl Default for VcshConfig<'_> { impl Default for VcshConfig<'_> {
fn default() -> Self { fn default() -> Self {
VcshConfig { Self {
symbol: "", symbol: "",
style: "bold yellow", style: "bold yellow",
format: "vcsh [$symbol$repo]($style) ", format: "vcsh [$symbol$repo]($style) ",
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct ZigConfig<'a> {
impl Default for ZigConfig<'_> { impl Default for ZigConfig<'_> {
fn default() -> Self { fn default() -> Self {
ZigConfig { Self {
format: "via [$symbol($version )]($style)", format: "via [$symbol($version )]($style)",
version_format: "v${raw}", version_format: "v${raw}",
symbol: "", symbol: "",
+3 -3
View File
@@ -109,7 +109,7 @@ impl<'a> Context<'a> {
.or_else(|| env::var("PWD").map(PathBuf::from).ok()) .or_else(|| env::var("PWD").map(PathBuf::from).ok())
.unwrap_or_else(|| path.clone()); .unwrap_or_else(|| path.clone());
Context::new_with_shell_and_path( Self::new_with_shell_and_path(
arguments, arguments,
shell, shell,
target, target,
@@ -162,7 +162,7 @@ impl<'a> Context<'a> {
let width = properties.terminal_width; let width = properties.terminal_width;
Context { Self {
config, config,
properties, properties,
current_dir, current_dir,
@@ -462,7 +462,7 @@ impl<'a> Context<'a> {
impl Default for Context<'_> { impl Default for Context<'_> {
fn default() -> Self { fn default() -> Self {
Context::new(Default::default(), Target::Main) Self::new(Default::default(), Target::Main)
} }
} }
+4 -4
View File
@@ -34,13 +34,13 @@ pub enum StyleElement<'a> {
impl<'a> VariableHolder<Cow<'a, str>> for FormatElement<'a> { impl<'a> VariableHolder<Cow<'a, str>> for FormatElement<'a> {
fn get_variables(&self) -> BTreeSet<Cow<'a, str>> { fn get_variables(&self) -> BTreeSet<Cow<'a, str>> {
match self { match self {
FormatElement::Variable(var) => { Self::Variable(var) => {
let mut variables = BTreeSet::new(); let mut variables = BTreeSet::new();
variables.insert(var.clone()); variables.insert(var.clone());
variables variables
} }
FormatElement::TextGroup(textgroup) => textgroup.format.get_variables(), Self::TextGroup(textgroup) => textgroup.format.get_variables(),
FormatElement::Conditional(format) => format.get_variables(), Self::Conditional(format) => format.get_variables(),
_ => Default::default(), _ => Default::default(),
} }
} }
@@ -67,7 +67,7 @@ impl<'a> VariableHolder<Cow<'a, str>> for &[FormatElement<'a>] {
impl<'a> StyleVariableHolder<Cow<'a, str>> for StyleElement<'a> { impl<'a> StyleVariableHolder<Cow<'a, str>> for StyleElement<'a> {
fn get_style_variables(&self) -> BTreeSet<Cow<'a, str>> { fn get_style_variables(&self) -> BTreeSet<Cow<'a, str>> {
match self { match self {
StyleElement::Variable(var) => { Self::Variable(var) => {
let mut variables = BTreeSet::new(); let mut variables = BTreeSet::new();
variables.insert(var.clone()); variables.insert(var.clone());
variables variables
+1 -1
View File
@@ -22,7 +22,7 @@ enum VariableValue<'a> {
impl Default for VariableValue<'_> { impl Default for VariableValue<'_> {
fn default() -> Self { fn default() -> Self {
VariableValue::Plain(Cow::Borrowed("")) Self::Plain(Cow::Borrowed(""))
} }
} }
+1 -1
View File
@@ -133,7 +133,7 @@ impl<'a> Module<'a> {
desc: impl Into<String>, desc: impl Into<String>,
config: Option<&'a toml::Value>, config: Option<&'a toml::Value>,
) -> Self { ) -> Self {
Module { Self {
config, config,
name: name.into(), name: name.into(),
description: desc.into(), description: desc.into(),
+2 -2
View File
@@ -373,8 +373,8 @@ impl GitDiff {
let deleted_re = Regex::new(r"(\d+) \w+\(\-\)").unwrap(); let deleted_re = Regex::new(r"(\d+) \w+\(\-\)").unwrap();
Self { Self {
added: GitDiff::get_matched_str(diff, &added_re).to_owned(), added: Self::get_matched_str(diff, &added_re).to_owned(),
deleted: GitDiff::get_matched_str(diff, &deleted_re).to_owned(), deleted: Self::get_matched_str(diff, &deleted_re).to_owned(),
} }
} }

Some files were not shown because too many files have changed in this diff Show More