mirror of
https://github.com/servo/servo.git
synced 2025-08-15 18:35:33 +01:00
Use env::var_os to read paths from the environment
This avoids unnecessary UTF-8 validation on OsStrings that we just pass back to the OS.
This commit is contained in:
parent
fe16c1d5c3
commit
c169f52b25
7 changed files with 19 additions and 18 deletions
|
@ -10,7 +10,7 @@ use std::io::{BufReader, BufRead};
|
|||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
let static_atoms = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap()).join("static_atoms.txt");
|
||||
let static_atoms = Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap()).join("static_atoms.txt");
|
||||
let static_atoms = BufReader::new(File::open(&static_atoms).unwrap());
|
||||
let mut atom_type = string_cache_codegen::AtomType::new("Atom", "atom!");
|
||||
|
||||
|
@ -27,6 +27,6 @@ fn main() {
|
|||
|
||||
atom_type
|
||||
.atoms(static_atoms.lines().map(Result::unwrap))
|
||||
.write_to_file(&Path::new(&env::var("OUT_DIR").unwrap()).join("atom.rs"))
|
||||
.write_to_file(&Path::new(&env::var_os("OUT_DIR").unwrap()).join("atom.rs"))
|
||||
.unwrap();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue