Skip to content

Commit

Permalink
0.0.36
Browse files Browse the repository at this point in the history
  • Loading branch information
Billy-Sheppard committed Sep 13, 2024
1 parent e29de86 commit e2a7743
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chart-js-rs"
version = "0.0.35"
version = "0.0.36"
edition = "2021"
authors = ["Billy Sheppard", "Luis Moreno"]
license = "Apache-2.0"
Expand All @@ -13,7 +13,7 @@ homepage = "https://github.com/Billy-Sheppard/chart-js-rs"

[dependencies]
rust_decimal = "1.34"
serde = { version = "1.0.189", features = ["derive"] }
serde = { version = "1.0.210", features = ["derive"] }
wasm-bindgen = { version = "0.2.90", features = ["serde-serialize"] }
gloo-utils = { version = "0.2", features = ["serde"] }
gloo-console = { version = "0.3" }
Expand Down
12 changes: 9 additions & 3 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,18 @@ impl<'de> Deserialize<'de> for NumberOrDateString {
#[derive(Debug, Clone, Default, PartialEq, Eq, PartialOrd, Ord)]
pub struct BoolString(String);
impl BoolString {
pub fn true_() -> Option<BoolString> {
pub fn opt_true() -> Option<BoolString> {
BoolString("true".into()).into()
}
pub fn false_() -> Option<BoolString> {
pub fn opt_false() -> Option<BoolString> {
BoolString("false".into()).into()
}
pub fn _true() -> BoolString {
BoolString("true".into())
}
pub fn _false() -> BoolString {
BoolString("false".into())
}
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
Expand Down Expand Up @@ -976,7 +982,7 @@ pub struct DataLabels {
pub clip: Option<bool>,
#[serde(skip_serializing_if = "String::is_empty", default)]
pub color: String,
#[serde(skip_serializing_if = "BoolString::is_empty", default)]
#[serde(default = "BoolString::_false")]
pub display: BoolString,
#[serde(skip_serializing_if = "NumberString::is_empty", default)]
pub drawTime: NumberString,
Expand Down

0 comments on commit e2a7743

Please sign in to comment.