You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wonder if there were any specific intentions for these? (I didn't get into it too deep yet and found no previous issue tracking these)
src/dom.rs: if let Some(url) = unsafe { (*attributes).get_mut(*attribute) } {
src/scraper.rs: let data_utf8 = unsafe { String::from_utf8_unchecked(Vec::from(data)) };
src/dom.rs
for node in nodes {let attributes = node.deref().attributes.as_ptr();for attribute inCSS_ATTRIBUTES.iter(){ifletSome(url) = unsafe{(*attributes).get_mut(*attribute)}{
vec.push(url);}}}
src/scraper.rs
fn find_charset(data:&[u8],http_charset:Option<String>) -> Option<String>{lazy_static!{static ref CHARSET_REGEX: Regex =
Regex::new("<meta.*charset\\s*=\\s*\"?([^\"\\s;>]+).*>").unwrap();
}// We don't know the real charset yet. We hope that the charset is ASCII// compatible, because Rust String are in UTF-8 (also ASCII compatible).let data_utf8 = unsafe{String::from_utf8_unchecked(Vec::from(data))};let captures = CHARSET_REGEX.captures_iter(&data_utf8).next();
The text was updated successfully, but these errors were encountered:
@Skallwar @CohenArthur
I ran a geiger and came across couple of unsafes.
Wonder if there were any specific intentions for these? (I didn't get into it too deep yet and found no previous issue tracking these)
src/dom.rs
src/scraper.rs
The text was updated successfully, but these errors were encountered: