From c4e3da9e7c8afcf1317a4f05c02f17c7ace2de0f Mon Sep 17 00:00:00 2001 From: Wilson Lin Date: Sat, 7 Aug 2021 20:16:02 +1000 Subject: [PATCH] Fix Ruby library --- ruby/src/lib.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ruby/src/lib.rs b/ruby/src/lib.rs index 56b7613..beb7ad2 100644 --- a/ruby/src/lib.rs +++ b/ruby/src/lib.rs @@ -29,19 +29,19 @@ methods! { .unwrap(); let cfg = &Cfg { - keep_closing_tags: get_cfg_hash_prop(cfg_hash, "keep_closing_tags"), - keep_comments: get_cfg_hash_prop(cfg_hash, "keep_comments"), - keep_html_and_head_opening_tags: get_cfg_hash_prop(cfg_hash, "keep_html_and_head_opening_tags"), - keep_spaces_between_attributes: get_cfg_hash_prop(cfg_hash, "keep_spaces_between_attributes"), - minify_css: get_cfg_hash_prop(cfg_hash, "minify_css"), - minify_js: get_cfg_hash_prop(cfg_hash, "minify_js"), - remove_bangs: get_cfg_hash_prop(cfg_hash, "remove_bangs"), - remove_processing_instructions: get_cfg_hash_prop(cfg_hash, "remove_processing_instructions"), + keep_closing_tags: get_cfg_hash_prop!(cfg_hash, "keep_closing_tags"), + keep_comments: get_cfg_hash_prop!(cfg_hash, "keep_comments"), + keep_html_and_head_opening_tags: get_cfg_hash_prop!(cfg_hash, "keep_html_and_head_opening_tags"), + keep_spaces_between_attributes: get_cfg_hash_prop!(cfg_hash, "keep_spaces_between_attributes"), + minify_css: get_cfg_hash_prop!(cfg_hash, "minify_css"), + minify_js: get_cfg_hash_prop!(cfg_hash, "minify_js"), + remove_bangs: get_cfg_hash_prop!(cfg_hash, "remove_bangs"), + remove_processing_instructions: get_cfg_hash_prop!(cfg_hash, "remove_processing_instructions"), }; let out_code = minify_html_native(&code, cfg); let out_str = from_utf8(&out_code).unwrap(); - RString::new_utf8(out_str).unwrap() + RString::new_utf8(out_str) } }