mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
chore: handle recent dependency updates & fix clippy warnings (#6773)
* build(deps): update rust crate schemars to 0.9.0 * chore: handle schemars update * build(deps): update rust crate nix to 0.30.1 * chore(os): handle os-info update * chore: handle clippy warnings --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
+2624
-3030
File diff suppressed because it is too large
Load Diff
Generated
+35
-43
@@ -703,7 +703,7 @@ dependencies = [
|
||||
"libc",
|
||||
"option-ext",
|
||||
"redox_users 0.5.0",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1771,12 +1771,6 @@ dependencies = [
|
||||
"byteorder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.14.5"
|
||||
@@ -1982,17 +1976,6 @@ dependencies = [
|
||||
"hashbrown 0.15.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "1.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"hashbrown 0.12.3",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.9.0"
|
||||
@@ -2288,18 +2271,6 @@ dependencies = [
|
||||
"syn 2.0.101",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.29.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
|
||||
dependencies = [
|
||||
"bitflags 2.9.1",
|
||||
"cfg-if",
|
||||
"cfg_aliases",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.30.1"
|
||||
@@ -2679,7 +2650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3d77244ce2d584cd84f6a15f86195b8c9b2a0dfbfd817c09e0464244091a58ed"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"indexmap 2.9.0",
|
||||
"indexmap",
|
||||
"quick-xml",
|
||||
"serde",
|
||||
"time",
|
||||
@@ -2939,6 +2910,26 @@ dependencies = [
|
||||
"thiserror 2.0.12",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ref-cast"
|
||||
version = "1.0.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf"
|
||||
dependencies = [
|
||||
"ref-cast-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ref-cast-impl"
|
||||
version = "1.0.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.11.1"
|
||||
@@ -3015,13 +3006,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "schemars"
|
||||
version = "0.8.22"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
|
||||
checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f"
|
||||
dependencies = [
|
||||
"dyn-clone",
|
||||
"indexmap 1.9.3",
|
||||
"indexmap 2.9.0",
|
||||
"indexmap",
|
||||
"ref-cast",
|
||||
"schemars_derive",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -3029,9 +3020,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "schemars_derive"
|
||||
version = "0.8.22"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d"
|
||||
checksum = "5016d94c77c6d32f0b8e08b781f7dc8a90c2007d4e77472cc2807bc10a8438fe"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -3106,6 +3097,7 @@ version = "1.0.140"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"itoa",
|
||||
"memchr",
|
||||
"ryu",
|
||||
@@ -3281,11 +3273,11 @@ dependencies = [
|
||||
"gix",
|
||||
"guess_host_triple",
|
||||
"home",
|
||||
"indexmap 2.9.0",
|
||||
"indexmap",
|
||||
"jsonc-parser",
|
||||
"log",
|
||||
"mockall",
|
||||
"nix 0.29.0",
|
||||
"nix",
|
||||
"notify-rust",
|
||||
"nu-ansi-term",
|
||||
"open",
|
||||
@@ -3336,7 +3328,7 @@ dependencies = [
|
||||
"lazycell",
|
||||
"libc",
|
||||
"mach2",
|
||||
"nix 0.30.1",
|
||||
"nix",
|
||||
"num-traits",
|
||||
"plist",
|
||||
"uom",
|
||||
@@ -3619,7 +3611,7 @@ version = "0.8.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
|
||||
dependencies = [
|
||||
"indexmap 2.9.0",
|
||||
"indexmap",
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
@@ -3641,7 +3633,7 @@ version = "0.22.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
|
||||
dependencies = [
|
||||
"indexmap 2.9.0",
|
||||
"indexmap",
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
@@ -4369,7 +4361,7 @@ dependencies = [
|
||||
"futures-core",
|
||||
"futures-lite",
|
||||
"hex",
|
||||
"nix 0.30.1",
|
||||
"nix",
|
||||
"ordered-stream",
|
||||
"serde",
|
||||
"serde_repr",
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@ home = "0.5.11"
|
||||
shell-words = "1.1.0"
|
||||
|
||||
[dependencies.schemars]
|
||||
version = "0.8.22"
|
||||
version = "0.9.0"
|
||||
optional = true
|
||||
features = ["preserve_order", "indexmap2"]
|
||||
|
||||
@@ -108,7 +108,7 @@ features = [
|
||||
]
|
||||
|
||||
[target.'cfg(not(windows))'.dependencies]
|
||||
nix = { version = "0.29.0", default-features = false, features = ["feature", "fs", "user"] }
|
||||
nix = { version = "0.30.1", default-features = false, features = ["feature", "fs", "user"] }
|
||||
|
||||
[build-dependencies]
|
||||
shadow-rs = { version = "1.2.0", default-features = false, features = ["build"] }
|
||||
|
||||
@@ -3445,6 +3445,7 @@ AlmaLinux = "💠 "
|
||||
Alpine = "🏔️ "
|
||||
Amazon = "🙂 "
|
||||
Android = "🤖 "
|
||||
AOSC = "🐱 "
|
||||
Arch = "🎗️ "
|
||||
Artix = "🎗️ "
|
||||
Bluefin = "🐟 "
|
||||
|
||||
@@ -48,6 +48,7 @@ Fedora = ""
|
||||
Alpine = ""
|
||||
Amazon = ""
|
||||
Android = ""
|
||||
AOSC = ""
|
||||
Arch = ""
|
||||
Artix = ""
|
||||
CentOS = ""
|
||||
|
||||
@@ -61,6 +61,7 @@ Fedora = ""
|
||||
Alpine = ""
|
||||
Amazon = ""
|
||||
Android = ""
|
||||
AOSC = ""
|
||||
Arch = ""
|
||||
Artix = ""
|
||||
EndeavourOS = ""
|
||||
|
||||
@@ -109,6 +109,7 @@ Alpine = " "
|
||||
AlmaLinux = " "
|
||||
Amazon = " "
|
||||
Android = " "
|
||||
AOSC = " "
|
||||
Arch = " "
|
||||
Artix = " "
|
||||
CachyOS = " "
|
||||
|
||||
@@ -146,6 +146,7 @@ AlmaLinux = "alma "
|
||||
Alpine = "alp "
|
||||
Amazon = "amz "
|
||||
Android = "andr "
|
||||
AOSC = "aosc "
|
||||
Arch = "rch "
|
||||
Artix = "atx "
|
||||
Bluefin = "blfn "
|
||||
|
||||
+6
-5
@@ -102,16 +102,17 @@ impl<T> schemars::JsonSchema for VecOr<T>
|
||||
where
|
||||
T: schemars::JsonSchema + Sized,
|
||||
{
|
||||
fn schema_name() -> String {
|
||||
fn schema_name() -> Cow<'static, str> {
|
||||
Either::<T, Vec<T>>::schema_name()
|
||||
}
|
||||
|
||||
fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
|
||||
Either::<T, Vec<T>>::json_schema(generator)
|
||||
fn schema_id() -> Cow<'static, str> {
|
||||
let mod_path = module_path!();
|
||||
Cow::Owned(format!("{mod_path}::{}", Self::schema_name()))
|
||||
}
|
||||
|
||||
fn is_referenceable() -> bool {
|
||||
Either::<T, Vec<T>>::is_referenceable()
|
||||
fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
|
||||
Either::<T, Vec<T>>::json_schema(generator)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ impl Default for OSConfig<'_> {
|
||||
Type::Alpine => "🏔️ ",
|
||||
Type::Amazon => "🙂 ",
|
||||
Type::Android => "🤖 ",
|
||||
Type::AOSC => "🐱 ",
|
||||
Type::Arch => "🎗️ ",
|
||||
Type::Artix => "🎗️ ",
|
||||
Type::Bluefin => "🐟 ",
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ impl StarshipPath {
|
||||
let current_exe = self
|
||||
.native_path
|
||||
.to_str()
|
||||
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "can't convert to str"))?;
|
||||
.ok_or_else(|| io::Error::other("can't convert to str"))?;
|
||||
Ok(current_exe)
|
||||
}
|
||||
|
||||
|
||||
@@ -134,6 +134,7 @@ mod tests {
|
||||
(Type::Alpine, Some("🏔️ ")),
|
||||
(Type::Amazon, Some("🙂 ")),
|
||||
(Type::Android, Some("🤖 ")),
|
||||
(Type::AOSC, Some("🐱 ")),
|
||||
(Type::Arch, Some("🎗️ ")),
|
||||
(Type::CentOS, Some("💠 ")),
|
||||
(Type::Debian, Some("🌀 ")),
|
||||
@@ -181,6 +182,7 @@ mod tests {
|
||||
Alpine = " "
|
||||
Amazon = " "
|
||||
Android = " "
|
||||
AOSC = " "
|
||||
Arch = " "
|
||||
CentOS = " "
|
||||
Debian = " "
|
||||
@@ -222,6 +224,7 @@ mod tests {
|
||||
(Type::Alpine, Some(" ")),
|
||||
(Type::Amazon, Some(" ")),
|
||||
(Type::Android, Some(" ")),
|
||||
(Type::AOSC, Some(" ")),
|
||||
(Type::Arch, Some(" ")),
|
||||
(Type::CentOS, Some(" ")),
|
||||
(Type::Debian, Some(" ")),
|
||||
@@ -276,6 +279,7 @@ mod tests {
|
||||
(Type::Alpine, Some("🏔️ ")),
|
||||
(Type::Amazon, Some("🙂 ")),
|
||||
(Type::Android, Some("🤖 ")),
|
||||
(Type::AOSC, Some("🐱 ")),
|
||||
(Type::Arch, Some("Arch is the best!")),
|
||||
(Type::CentOS, Some("💠 ")),
|
||||
(Type::Debian, Some("🌀 ")),
|
||||
@@ -336,6 +340,7 @@ mod tests {
|
||||
Type::Alpine => "🏔️ ",
|
||||
Type::Amazon => "🙂 ",
|
||||
Type::Android => "🤖 ",
|
||||
Type::AOSC => "🐱 ",
|
||||
Type::Arch | Type::Artix | Type::CachyOS => "🎗️ ",
|
||||
Type::Bluefin => "🐟 ",
|
||||
Type::CentOS | Type::AlmaLinux | Type::RockyLinux => "💠 ",
|
||||
|
||||
@@ -12,14 +12,13 @@ pub fn truncate_text(text: &str, length: usize, truncation_symbol: &str) -> Stri
|
||||
|
||||
let truncated_graphemes = get_graphemes(text, length);
|
||||
// The truncation symbol should only be added if we truncated
|
||||
let truncated_and_symbol = if length < graphemes_len(text) {
|
||||
|
||||
if length < graphemes_len(text) {
|
||||
let truncation_symbol = get_graphemes(truncation_symbol, 1);
|
||||
truncated_graphemes + truncation_symbol.as_str()
|
||||
} else {
|
||||
truncated_graphemes
|
||||
};
|
||||
|
||||
truncated_and_symbol
|
||||
}
|
||||
}
|
||||
|
||||
fn get_graphemes(text: &str, length: usize) -> String {
|
||||
|
||||
Reference in New Issue
Block a user