1
Fork 0

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:
Steven Fackler 2014-03-26 09:24:16 -07:00
parent 94a055c729
commit d0e60b72ee
27 changed files with 117 additions and 108 deletions

View file

@ -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") {