we dont need to check that output buffer is valid utf8
This commit is contained in:
parent
fe92c5ed63
commit
8ff334f26a
@ -129,12 +129,11 @@ impl Css {
|
||||
let mut string = Vec::new();
|
||||
self._inner_pretty_print(&mut string, map, 0)?;
|
||||
if string.iter().any(|s| !s.is_ascii()) {
|
||||
return Ok(format!(
|
||||
"@charset \"UTF-8\";\n{}",
|
||||
String::from_utf8(string)?
|
||||
));
|
||||
return Ok(format!("@charset \"UTF-8\";\n{}", unsafe {
|
||||
String::from_utf8_unchecked(string)
|
||||
}));
|
||||
}
|
||||
Ok(String::from_utf8(string)?)
|
||||
Ok(unsafe { String::from_utf8_unchecked(string) })
|
||||
}
|
||||
|
||||
fn debug(map: &CodeMap, span: Span, message: &str) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user