summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-12-12 23:42:00 -0800
committerGitHub <noreply@github.com>2016-12-12 23:42:00 -0800
commita0ace87c8a36ce0fdc11fe71b610689e9cf88bf0 (patch)
treed8c3b1f1828f19a2b1d44cf878aa20ac51acd4ad
parent5d9c48e59b49135db1ecfd4ff8c3dbab8ed05086 (diff)
parent3f711d85e72a4e4a516a8b128a9b212d8305b035 (diff)
Auto merge of #331 - upsuper:patch-2, r=emilio
Fix issues in README Mainly for fixing `env!("OUT_DIR")` usage in `build.rs`.
-rw-r--r--README.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/README.md b/README.md
index 09f88db2..f25b815b 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,7 @@ In `Cargo.toml`:
```toml
[package]
-...
+# ...
build = "build.rs"
[build-dependencies.libbindgen]
@@ -95,12 +95,16 @@ In `build.rs`:
```rust
extern crate libbindgen;
+use std::env;
+use std::path::Path;
+
fn main() {
+ let out_dir = env::var("OUT_DIR").unwrap();
let _ = libbindgen::builder()
.header("example.h")
.use_core()
.generate().unwrap()
- .write_to_file(concat!(env!("OUT_DIR"), "/example.rs"));
+ .write_to_file(Path::new(&out_dir).join("example.rs"));
}
```