Skip to content

rich_rust v0.2.4

Latest

Choose a tag to compare

@Dicklesworthstone Dicklesworthstone released this 21 Nov 22:24

rich_rust is a Rust library crate. Distribution is via crates.io — this release intentionally carries no binary assets, matching v0.2.1 and v0.2.3.

[dependencies]
rich_rust = "0.2.4"

Highlights

Bug Fixes

  • Markdown / Syntax unknown-language fenced code blocks (7aef687):
    • Recognized common plain-text lexer aliases ("text", "plaintext", "plain", "txt") in Syntax::render via syntect's plain-text syntax definition while preserving SyntaxError::UnknownLanguage for unrecognized language names.
    • Hardened Markdown::render's unknown-language fenced code block fallback so blocks with non-bundled lexers (such as toml or text) render with plain styling instead of silently disappearing when the syntax feature is enabled.
    • Added unit (test_render_plain_text_aliases) and end-to-end (test_md_fenced_code_block_unknown_language_fallback) regression tests.
  • All-features lints & showcase snapshots (7aef687):
    • Fixed clippy::needless_bool in Traceback under the backtrace feature and clippy::assert_is_empty across feature-gated unit tests.
    • Updated demo_showcase golden snapshots to reflect current Python Rich parity and restored TOML fenced code blocks.

Security & Dependencies

  • Zero security vulnerabilities / zero unsound advisories (52412f8):
    • pulldown-cmark 0.13.4 → 0.13.6 (manifest minimum bumped to 0.13.6; resolves RUSTSEC-2026-0433 and RUSTSEC-2026-0414).
    • rustix (transitive) 1.1.4 → 1.1.6 (resolves RUSTSEC-2026-0486).
    • Upgraded fancy-regex (0.18 → 0.20.2), lru (0.18 → 0.19.1, removing allocator-api2), serial_test (3.5 → 4.0.1), time (0.3.54 → 0.3.55), and compatible minor/patch dependencies (backtrace, bitflags, insta, log, proptest, regex, serde_json, smallvec, unicode-width).
    • cargo audit passes with 0 vulnerabilities and 0 unsound warnings (2 upstream unmaintained transitive warnings remain under latest syntect 5.3.0: bincode 1.3.3 / RUSTSEC-2025-0141, yaml-rust 0.4.5 / RUSTSEC-2024-0320).

Performance

  • Release profile switched to opt-level = 3 (52412f8):
    • Switched [profile.release] from opt-level = "z" to opt-level = 3 (retaining lto = true, codegen-units = 1, panic = "abort", strip = true).
    • Back-to-back A/B benchmarking across all 38 Criterion benchmarks confirmed 38/38 improved (0 regressions) with ~1.5x–1.9x geometric mean speedup (including 3.6x–7.6x faster 10 KB text wrapping and rendering, 2.1x–2.3x faster cell width calculation, and 1.7x–2.1x faster ANSI style rendering).
    • Showcase binary (demo_showcase --release --features showcase): median wall time reduced -17.6% (1021.4 ms → 842.1 ms) for a +1.07 MiB stripped binary size tradeoff (3.81 MiB → 4.88 MiB).

Verification

  • cargo fmt --check — pass
  • cargo clippy --all-targets --all-features -- -D warnings — pass
  • cargo test --all-features --no-fail-fast — 3,895 passed, 0 failed (52 ignored, across 40 test suites including demo_showcase_e2e, demo_showcase_snapshots, conformance_python, e2e_markdown, property/fuzz/regression, and doctests)
  • cargo doc --no-deps --all-features (RUSTDOCFLAGS="-D warnings") — pass
  • cargo check --no-default-features --all-targets — pass
  • cargo audit — 0 vulnerabilities, 0 unsound warnings
  • cargo publish --dry-run --locked — pass

Full Changelog: v0.2.3...v0.2.4