From d21dd97c1009206806cfc82680f682f1c7082cf5 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Tue, 4 Jan 2022 01:52:42 +0300 Subject: [PATCH] Update readme with a simple example --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a17fb57..7bc6839 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,14 @@ Quick summary: ### Examples ```rust -todo!(); +use qoi_fast::{encode_to_vec, decode_to_vec}; + +let encoded = encode_to_vec(&pixels, width, height)?; +let (header, decoded) = decode_to_vec(&encoded)?; + +assert_eq!(header.width, width); +assert_eq!(header.height, height); +assert_eq!(decoded, pixels); ``` ### Benchmarks