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();
|
let mut string = Vec::new();
|
||||||
self._inner_pretty_print(&mut string, map, 0)?;
|
self._inner_pretty_print(&mut string, map, 0)?;
|
||||||
if string.iter().any(|s| !s.is_ascii()) {
|
if string.iter().any(|s| !s.is_ascii()) {
|
||||||
return Ok(format!(
|
return Ok(format!("@charset \"UTF-8\";\n{}", unsafe {
|
||||||
"@charset \"UTF-8\";\n{}",
|
String::from_utf8_unchecked(string)
|
||||||
String::from_utf8(string)?
|
}));
|
||||||
));
|
|
||||||
}
|
}
|
||||||
Ok(String::from_utf8(string)?)
|
Ok(unsafe { String::from_utf8_unchecked(string) })
|
||||||
}
|
}
|
||||||
|
|
||||||
fn debug(map: &CodeMap, span: Span, message: &str) {
|
fn debug(map: &CodeMap, span: Span, message: &str) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user