Skip to content

Commit

Permalink
Merge branch 'main' into refactor/extract-settings-crate
Browse files Browse the repository at this point in the history
  • Loading branch information
friedow committed Oct 27, 2024
2 parents b14d729 + 56697f1 commit 35e4825
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
5 changes: 1 addition & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager";
treefmt-nix.url = "github:numtide/treefmt-nix/";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
crane.url = "github:ipetkov/crane";
};

outputs =
Expand Down
21 changes: 18 additions & 3 deletions settings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,39 @@ pub struct GitRepositoriesPluginSettings {
pub commands: Vec<Vec<String>>,
}

fn default_white() -> String {
"#ffffff".into()
}

fn default_black() -> String {
"#000000".into()
}

fn default_deprecated() -> String {
"deprecated".into()
}

#[derive(Debug, Deserialize)]
pub struct ColorSettings {
#[serde(default = "default_white")]
pub text: String,
#[serde(default = "default_black")]
pub background: String,
#[deprecated(
since = "1.2.0",
note = "color.surface has been replaced by automatic shading of the background color. Please remove this field from your configuration."
)]
#[serde(default = "default_deprecated")]
pub surface: String,
}

impl Default for ColorSettings {
fn default() -> Self {
#[allow(deprecated)]
Self {
text: "#ffffff".to_string(),
background: "#000000".to_string(),
surface: "deprecated".to_string(),
text: default_white(),
background: default_black(),
surface: default_deprecated(),
}
}
}
Expand Down

0 comments on commit 35e4825

Please sign in to comment.