fix(configure): fix print-config issues (#2556)

This commit is contained in:
David Knaack 2021-04-05 16:47:49 +02:00 committed by GitHub
parent 7273c8a42a
commit b791383a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -66,8 +66,12 @@ pub use starship_root::*;
#[derive(Default, Serialize, ModuleConfig, Clone)] #[derive(Default, Serialize, ModuleConfig, Clone)]
#[serde(default)] #[serde(default)]
pub struct FullConfig<'a> { pub struct FullConfig<'a> {
#[serde(flatten)] // Root config
root: starship_root::StarshipRootConfig<'a>, pub format: &'a str,
pub scan_timeout: u64,
pub command_timeout: u64,
pub add_newline: bool,
// modules
aws: aws::AwsConfig<'a>, aws: aws::AwsConfig<'a>,
battery: battery::BatteryDisplayConfig<'a>, battery: battery::BatteryDisplayConfig<'a>,
character: character::CharacterConfig<'a>, character: character::CharacterConfig<'a>,
@ -88,7 +92,7 @@ pub struct FullConfig<'a> {
git_commit: git_commit::GitCommitConfig<'a>, git_commit: git_commit::GitCommitConfig<'a>,
git_state: git_state::GitStateConfig<'a>, git_state: git_state::GitStateConfig<'a>,
git_status: git_status::GitStatusConfig<'a>, git_status: git_status::GitStatusConfig<'a>,
go: go::GoConfig<'a>, golang: go::GoConfig<'a>,
helm: helm::HelmConfig<'a>, helm: helm::HelmConfig<'a>,
hg_branch: hg_branch::HgBranchConfig<'a>, hg_branch: hg_branch::HgBranchConfig<'a>,
hostname: hostname::HostnameConfig<'a>, hostname: hostname::HostnameConfig<'a>,

View File

@ -2,6 +2,7 @@ use crate::{config::ModuleConfig, module::ALL_MODULES};
use serde::Serialize; use serde::Serialize;
// On changes please also update the `FullConfig` struct in `mod.rs`
#[derive(Clone, Serialize)] #[derive(Clone, Serialize)]
pub struct StarshipRootConfig<'a> { pub struct StarshipRootConfig<'a> {
pub format: &'a str, pub format: &'a str,