feat(no_std): make palette and serde features depends on std (#1919)

This commit is contained in:
Jagoda Estera Ślązak
2025-06-24 08:00:40 +02:00
committed by GitHub
parent 488e5f020f
commit 1399d95ae0
2 changed files with 4 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ layout-cache = ["std"]
anstyle = ["dep:anstyle"]
## enables conversions from colors in the [`palette`] crate to [`Color`](crate::style::Color).
palette = ["dep:palette"]
palette = ["std", "dep:palette"]
## enables the backend code that sets the underline color. Underline color is only supported by
## the Crossterm backend, and is not supported on Windows 7.
@@ -53,7 +53,7 @@ scrolling-regions = []
## enables serialization and deserialization of style and color types using the [`serde`] crate.
## This is useful if you want to save themes to a file.
serde = ["dep:serde", "bitflags/serde", "compact_str/serde"]
serde = ["std", "dep:serde", "bitflags/serde", "compact_str/serde"]
[dependencies]
anstyle = { workspace = true, optional = true }

View File

@@ -44,6 +44,7 @@ std = ["ratatui-core/std", "ratatui-widgets/std"]
## enables serialization and deserialization of style and color types using the [`serde`] crate.
## This is useful if you want to save themes to a file.
serde = [
"std",
"dep:serde",
"ratatui-core/serde",
"ratatui-widgets/serde",
@@ -56,7 +57,7 @@ serde = [
layout-cache = ["std", "ratatui-core/layout-cache"]
## enables conversions from colors in the [`palette`] crate to [`Color`](crate::style::Color).
palette = ["ratatui-core/palette", "dep:palette"]
palette = ["std", "ratatui-core/palette", "dep:palette"]
## Use terminal scrolling regions to make some operations less prone to
## flickering. (i.e. Terminal::insert_before).