chart: Add decimal feature (#918)

This commit is contained in:
Floyd Wang 2025-06-05 16:03:20 +08:00 committed by GitHub
parent 4477cca969
commit ecfa6b8451
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 49 additions and 2 deletions

40
Cargo.lock generated
View file

@ -817,6 +817,29 @@ dependencies = [
"piper",
]
[[package]]
name = "borsh"
version = "1.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce"
dependencies = [
"borsh-derive",
"cfg_aliases",
]
[[package]]
name = "borsh-derive"
version = "1.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3"
dependencies = [
"once_cell",
"proc-macro-crate 3.2.0",
"proc-macro2",
"quote",
"syn 2.0.101",
]
[[package]]
name = "bstr"
version = "1.10.0"
@ -2868,6 +2891,7 @@ dependencies = [
"regex",
"resvg",
"rust-i18n",
"rust_decimal",
"schemars",
"serde",
"serde_json",
@ -5983,6 +6007,22 @@ dependencies = [
"triomphe",
]
[[package]]
name = "rust_decimal"
version = "1.37.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "faa7de2ba56ac291bd90c6b9bece784a52ae1411f9506544b3eae36dd2356d50"
dependencies = [
"arrayvec",
"borsh",
"bytes",
"num-traits",
"rand 0.8.5",
"rkyv",
"serde",
"serde_json",
]
[[package]]
name = "rustc-demangle"
version = "0.1.24"

View file

@ -12,6 +12,7 @@ version = "0.1.0"
doctest = false
[features]
decimal = ["dep:rust_decimal"]
inspector = []
webview = ["dep:wry"]
@ -25,7 +26,6 @@ futures-util = "0.3.31"
image = "0.25.1"
itertools = "0.13.0"
lyon = "1.0"
num-traits = "0.2"
once_cell = "1.19.0"
paste = "1"
regex = "1"
@ -42,6 +42,10 @@ usvg = { version = "0.45.0", default-features = false, features = ["text"] }
uuid = "1.10"
wry = { version = "0.48.0", optional = true }
# Chart
num-traits = "0.2"
rust_decimal = { version = "1.37.0", optional = true }
# Markdown Parser
markdown = "1.0.0-alpha.22"
@ -78,8 +82,8 @@ tree-sitter-python = "0.23.6"
tree-sitter-ruby = "0.23.1"
tree-sitter-rust = "0.24.0"
tree-sitter-scala = "0.23.4"
tree-sitter-swift = "0.7.0"
tree-sitter-sequel = "0.3.8"
tree-sitter-swift = "0.7.0"
tree-sitter-toml-ng = "0.7.0"
tree-sitter-typescript = "0.23.2"
tree-sitter-yaml = "0.7.1"

View file

@ -1,3 +1,6 @@
pub trait Sealed {}
impl Sealed for f64 {}
#[cfg(feature = "decimal")]
impl Sealed for rust_decimal::Decimal {}