De-~[] Reader and Writer
There's a little more allocation here and there now since from_utf8_owned can't be used with Vec.
This commit is contained in:
parent
94a055c729
commit
d0e60b72ee
27 changed files with 117 additions and 108 deletions
|
@ -487,7 +487,7 @@ impl<'a> SourceCollector<'a> {
|
|||
filename.ends_with("macros>") => return Ok(()),
|
||||
Err(e) => return Err(e)
|
||||
};
|
||||
let contents = str::from_utf8_owned(contents).unwrap();
|
||||
let contents = str::from_utf8(contents.as_slice()).unwrap();
|
||||
|
||||
// Remove the utf-8 BOM if any
|
||||
let contents = if contents.starts_with("\ufeff") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue