From 79d5165caed81db292073c18337fa69e83a20cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jagoda=20Estera=20=C5=9Al=C4=85zak?= <128227338+j-g00da@users.noreply.github.com> Date: Tue, 13 May 2025 19:48:45 +0200 Subject: [PATCH] fix(no_std): propagate `std` feature flag to dependencies (#1838) Disables `std` feature flags in dependencies and only enables them with `ratatui` and `ratatui-core`'s `std` feature flag. This partially fixes the issue of still depending on `std`, when `std` feature flag is disabled. --- Cargo.toml | 4 ++-- ratatui-core/Cargo.toml | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 99af44c8..735b5514 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ document-features = "0.2.11" hashbrown = "0.15.3" indoc = "2.0.6" instability = "0.3.7" -itertools = "0.13.0" +itertools = { version = "0.13.0", default-features = false, features = ["use_alloc"] } pretty_assertions = "1.4.1" ratatui = { path = "ratatui", version = "0.30.0-alpha.2" } ratatui-core = { path = "ratatui-core", version = "0.1.0-alpha.3" } @@ -46,7 +46,7 @@ ratatui-widgets = { path = "ratatui-widgets", version = "0.3.0-alpha.2" } rstest = "0.25.0" serde = { version = "1.0.219", features = ["derive"] } serde_json = "1.0.140" -strum = { version = "0.26.3", features = ["derive"] } +strum = { version = "0.26.3", default-features = false, features = ["derive"] } termion = "4.0.5" termwiz = { version = "0.23.3" } unicode-segmentation = "1.12.0" diff --git a/ratatui-core/Cargo.toml b/ratatui-core/Cargo.toml index 68430d7f..716a245c 100644 --- a/ratatui-core/Cargo.toml +++ b/ratatui-core/Cargo.toml @@ -25,7 +25,14 @@ rustdoc-args = ["--cfg", "docsrs"] default = [] ## enables std -std = [] +std = [ + "itertools/use_std", + "thiserror/std", + "kasuari/std", + "compact_str/std", + "unicode-truncate/std", + "strum/std", +] ## enables layout cache layout-cache = ["std"] @@ -51,19 +58,19 @@ serde = ["dep:serde", "bitflags/serde", "compact_str/serde"] [dependencies] anstyle = { version = "1", optional = true } bitflags = "2.3" -compact_str = "0.9.0" +compact_str = { version = "0.9.0", default-features = false } document-features = { workspace = true, optional = true } hashbrown = "0.15.2" indoc.workspace = true itertools.workspace = true -kasuari = "0.4.6" +kasuari = { version = "0.4.6", default-features = false } lru = "0.12.0" palette = { version = "0.7.6", optional = true } serde = { workspace = true, optional = true } strum.workspace = true -thiserror = "2" +thiserror = { version = "2", default-features = false } unicode-segmentation.workspace = true -unicode-truncate = "2" +unicode-truncate = { version = "2", default-features = false } unicode-width.workspace = true [dev-dependencies]