Fix Rust example duplication

This commit is contained in:
Wilson Lin 2020-05-12 17:35:32 +10:00
parent 7524e7c12b
commit caa738b8a9
1 changed files with 2 additions and 7 deletions

View File

@ -59,12 +59,13 @@ use hyperbuild::hyperbuild;
fn main() {
let mut code = b"<p> Hello, world! </p>".to_vec();
// `hyperbuild` minifies a slice in-place and returns the new minified length, but leaves any original code after the minified code intact.
match hyperbuild(&mut code) {
Ok(minified_len) => {}
Err((error_type, error_position)) => {}
};
// `hyperbuild_copy` creates a copy instead of minifying in-place.
// `hyperbuild_copy` creates a vector copy containing only minified code instead of minifying in-place.
match hyperbuild_copy(&code) {
Ok(minified) => {}
Err((error_type, error_position)) => {}
@ -76,12 +77,6 @@ fn main() {
Err((error_type, error_position)) => {}
};
// `hyperbuild` minifies a slice in place and returns the new minified length but leaves any original code after the minified code intact.
match hyperbuild(&mut code) {
Ok(minified_len) => {}
Err((error_type, error_position)) => {}
};
// `hyperbuild_friendly_error` is identical to `hyperbuild` except the error is a FriendlyError instead.
// `code_context` is a string of a visual representation of the source code with line numbers and position markers to aid in debugging syntax issues, and should be printed.
match hyperbuild_friendly_error(&mut code) {