Function rphtml::entity::decode_to

source ·
pub fn decode_to(content: &[u8], data: &mut Vec<u8>)
Expand description

Similar to the decode method, but directly writes the byte data into the last parameter passed in.

§Examples

use htmlentity::entity::*;
use htmlentity::types::ByteList;
use std::borrow::Cow;

let encoded_bytes = b"&lt;div class=&apos;header&apos;&gt;&lt;/div&gt;";
let mut data: ByteList = vec![];
decode_to(encoded_bytes, &mut data);
assert_eq!(data, b"<div class='header'></div>");