From ec17be9be99e4b64b061c2f8920ce55d9f950731 Mon Sep 17 00:00:00 2001 From: Wilson Lin Date: Fri, 24 Jul 2020 19:59:02 +1000 Subject: [PATCH] Fix Rust API examples in README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3d1df29..b390a98 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If the `js-esbuild` feature is not enabled, `cfg.minify_js` will have no effect. ##### Use ```rust -use minify_html::{Cfg, FriendlyError, in_place, copy, with_friendly_error, truncate}; +use minify_html::{Cfg, Error, FriendlyError, in_place, copy, with_friendly_error, truncate}; fn main() { let mut code = b"

Hello, world!

".to_vec(); @@ -64,21 +64,21 @@ fn main() { // but leaves any original code after the minified code intact. match in_place(&mut code, cfg) { Ok(minified_len) => {} - Err((error_type, error_position)) => {} + Err(Error { error_type, position }) => {} }; // Creates a vector copy containing only minified code // instead of minifying in-place. match copy(&code, cfg) { Ok(minified) => {} - Err((error_type, error_position)) => {} + Err(Error { error_type, position }) => {} }; // Minifies a vector in-place, and then truncates the // vector to the new minified length. match truncate(&mut code, cfg) { Ok(()) => {} - Err((error_type, error_position)) => {} + Err(Error { error_type, position }) => {} }; // Identical to `in_place` except with FriendlyError instead.