aboutsummaryrefslogtreecommitdiffstats
path: root/components/atoms
diff options
context:
space:
mode:
authorMatt Brubeck <mbrubeck@limpet.net>2017-10-20 09:03:21 -0700
committerMatt Brubeck <mbrubeck@limpet.net>2017-10-20 09:03:21 -0700
commitc169f52b2542886ed2244e4f7d903da7ba15463a (patch)
tree0931e3608dc205ed284f4861fa147e662bb7f7ca /components/atoms
parentfe16c1d5c3c9084da0ccb85af599d6ec0f8ab20b (diff)
downloadservo-c169f52b2542886ed2244e4f7d903da7ba15463a.tar.gz
servo-c169f52b2542886ed2244e4f7d903da7ba15463a.zip
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.
Diffstat (limited to 'components/atoms')
-rw-r--r--components/atoms/build.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/atoms/build.rs b/components/atoms/build.rs
index c8edc9bcd5a..8a6ba8fd936 100644
--- a/components/atoms/build.rs
+++ b/components/atoms/build.rs
@@ -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();
}