mirror of
https://github.com/starship/starship.git
synced 2024-11-25 01:33:41 +01:00
chore: fix rust 1.79 lint warnings (#6034)
* chore: fix rust 1.79 lint warnings * chore: update config-schema
This commit is contained in:
parent
eade2327e5
commit
aa05a1e5ab
9
.github/config-schema.json
vendored
9
.github/config-schema.json
vendored
@ -2095,12 +2095,14 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"charging_symbol": {
|
"charging_symbol": {
|
||||||
|
"default": null,
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"discharging_symbol": {
|
"discharging_symbol": {
|
||||||
|
"default": null,
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
@ -2771,12 +2773,14 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"repo_root_style": {
|
"repo_root_style": {
|
||||||
|
"default": null,
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"before_repo_root_style": {
|
"before_repo_root_style": {
|
||||||
|
"default": null,
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
@ -4291,30 +4295,35 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"user_pattern": {
|
"user_pattern": {
|
||||||
|
"default": null,
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"symbol": {
|
"symbol": {
|
||||||
|
"default": null,
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
|
"default": null,
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"context_alias": {
|
"context_alias": {
|
||||||
|
"default": null,
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"user_alias": {
|
"user_alias": {
|
||||||
|
"default": null,
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
|
@ -86,7 +86,7 @@ impl<'a> Context<'a> {
|
|||||||
/// Identify the current working directory and create an instance of Context
|
/// Identify the current working directory and create an instance of Context
|
||||||
/// for it. "logical-path" is used when a shell allows the "current working directory"
|
/// for it. "logical-path" is used when a shell allows the "current working directory"
|
||||||
/// to be something other than a file system path (like powershell provider specific paths).
|
/// to be something other than a file system path (like powershell provider specific paths).
|
||||||
pub fn new(arguments: Properties, target: Target) -> Context<'a> {
|
pub fn new(arguments: Properties, target: Target) -> Self {
|
||||||
let shell = Context::get_shell();
|
let shell = Context::get_shell();
|
||||||
|
|
||||||
// Retrieve the "current directory".
|
// Retrieve the "current directory".
|
||||||
@ -126,7 +126,7 @@ impl<'a> Context<'a> {
|
|||||||
path: PathBuf,
|
path: PathBuf,
|
||||||
logical_path: PathBuf,
|
logical_path: PathBuf,
|
||||||
env: Env<'a>,
|
env: Env<'a>,
|
||||||
) -> Context<'a> {
|
) -> Self {
|
||||||
let config = StarshipConfig::initialize(&get_config_path_os(&env));
|
let config = StarshipConfig::initialize(&get_config_path_os(&env));
|
||||||
|
|
||||||
// If the vector is zero-length, we should pretend that we didn't get a
|
// If the vector is zero-length, we should pretend that we didn't get a
|
||||||
@ -184,7 +184,7 @@ impl<'a> Context<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the context config, overwriting the existing config
|
/// Sets the context config, overwriting the existing config
|
||||||
pub fn set_config(mut self, config: toml::Table) -> Context<'a> {
|
pub fn set_config(mut self, config: toml::Table) -> Self {
|
||||||
self.root_config = StarshipRootConfig::load(&config);
|
self.root_config = StarshipRootConfig::load(&config);
|
||||||
self.config = StarshipConfig {
|
self.config = StarshipConfig {
|
||||||
config: Some(config),
|
config: Some(config),
|
||||||
|
@ -122,7 +122,7 @@ pub struct Module<'a> {
|
|||||||
|
|
||||||
impl<'a> Module<'a> {
|
impl<'a> Module<'a> {
|
||||||
/// Creates a module with no segments.
|
/// Creates a module with no segments.
|
||||||
pub fn new(name: &str, desc: &str, config: Option<&'a toml::Value>) -> Module<'a> {
|
pub fn new(name: &str, desc: &str, config: Option<&'a toml::Value>) -> Self {
|
||||||
Module {
|
Module {
|
||||||
config,
|
config,
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
|
@ -119,7 +119,6 @@ fn is_ssh_session(context: &Context) -> bool {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use gix::config::key;
|
|
||||||
|
|
||||||
use crate::test::ModuleRenderer;
|
use crate::test::ModuleRenderer;
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ pub fn get_prompt(context: Context) -> String {
|
|||||||
// color sequences for this specific shell
|
// color sequences for this specific shell
|
||||||
let shell_wrapped_output =
|
let shell_wrapped_output =
|
||||||
wrap_colorseq_for_shell(AnsiStrings(&module_strings).to_string(), context.shell);
|
wrap_colorseq_for_shell(AnsiStrings(&module_strings).to_string(), context.shell);
|
||||||
write!(buf, "{}", shell_wrapped_output).unwrap();
|
write!(buf, "{shell_wrapped_output}").unwrap();
|
||||||
|
|
||||||
if context.target == Target::Right {
|
if context.target == Target::Right {
|
||||||
// right prompts generally do not allow newlines
|
// right prompts generally do not allow newlines
|
||||||
|
@ -103,9 +103,9 @@ impl ValueDeserializer<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'de> IntoDeserializer<'de> for ValueDeserializer<'de> {
|
impl<'de> IntoDeserializer<'de> for ValueDeserializer<'de> {
|
||||||
type Deserializer = ValueDeserializer<'de>;
|
type Deserializer = Self;
|
||||||
|
|
||||||
fn into_deserializer(self) -> ValueDeserializer<'de> {
|
fn into_deserializer(self) -> Self {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user