From 51797cf7174409a1acdf5b4f116dabf3579563a6 Mon Sep 17 00:00:00 2001 From: Sebastien Rousseau Date: Sat, 23 Nov 2024 21:05:44 +0000 Subject: [PATCH] =?UTF-8?q?test(frontmatter-gen):=20=E2=9C=85=20Add=20new?= =?UTF-8?q?=20unit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 24 ++++++++---------------- src/engine.rs | 6 +++--- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index f6bcf54..452e9d6 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,12 @@ A high-performance Rust library for parsing and serialising frontmatter in YAML, ## Key Features 🎯 -- **Zero-Copy Parsing**: Parse YAML, TOML, and JSON frontmatter efficiently with zero memory copying -- **Safe Extraction**: Extract frontmatter using standard delimiters (`---` for YAML, `+++` for TOML) with comprehensive error handling -- **Type Safety**: Leverage Rust's type system with the `Value` enum for safe frontmatter manipulation -- **High Performance**: Optimised for speed with minimal allocations and efficient algorithms -- **Memory Safety**: Guaranteed memory safety through Rust's ownership system -- **Rich Error Handling**: Detailed error types with context for effective debugging -- **Async Support**: First-class asynchronous operation support -- **Flexible Configuration**: Customisable parsing behaviour to match your needs +- **Zero-copy parsing** for optimal memory efficiency +- **Multi-format support** (YAML, TOML, JSON) +- **Type-safe operations** with comprehensive error handling +- **Secure processing** with input validation and size limits +- **Async support** with the `ssg` feature flag +- **Command-line interface** for direct manipulation ## Available Features 🛠️ @@ -72,15 +70,9 @@ Add this to your `Cargo.toml`: ```toml [dependencies] +# Core library with command-line interface and SSG support +frontmatter-gen = { version = "0.0.4", features = ["cli", "ssg"] } -# Basic functionality -frontmatter-gen = "0.0.4" - -# With CLI support -frontmatter-gen = { version = "0.0.4", features = ["cli"] } - -# All features (CLI and SSG) -frontmatter-gen = { version = "0.0.4", features = ["ssg"] } ``` ## Basic Usage 🔨 diff --git a/src/engine.rs b/src/engine.rs index 83f7c5c..c987021 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -477,9 +477,9 @@ mod tests { let templates = engine.template_cache.read().await; assert_eq!( - templates.items.get("default"), - Some(&template_content.to_string()) - ); + templates.items.get("default"), + Some(&template_content.to_string()) +); temp_dir.close()?; Ok(())