Minor refactoring of Rust API `copy` example

This commit is contained in:
Wilson Lin 2020-08-26 14:42:42 +10:00
parent 3416691955
commit cf02e8265c
1 changed files with 2 additions and 2 deletions

View File

@ -126,13 +126,13 @@ pub fn truncate(code: &mut Vec<u8>, cfg: &Cfg) -> Result<(), Error> {
/// ```
/// use minify_html::{Cfg, Error, copy};
///
/// let mut code = b"<p> Hello, world! </p>".to_vec();
/// let mut code: &[u8] = b"<p> Hello, world! </p>";
/// let cfg = &Cfg {
/// minify_js: false,
/// };
/// match copy(&code, cfg) {
/// Ok(minified) => {
/// assert_eq!(code, b"<p> Hello, world! </p>".to_vec());
/// assert_eq!(code, b"<p> Hello, world! </p>");
/// assert_eq!(minified, b"<p>Hello, world!".to_vec());
/// }
/// Err(Error { error_type, position }) => {}