Skip to content

Commit 6e133ba

Browse files
george-hopkinsemilio
authored andcommitted
Use CargoCallbacks::new() in documentation
1 parent a8fa942 commit 6e133ba

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

bindgen/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ fn get_target_dependent_env_var(
12391239
/// use bindgen::builder;
12401240
/// let bindings = builder()
12411241
/// .header("path/to/input/header")
1242-
/// .parse_callbacks(Box::new(bindgen::CargoCallbacks))
1242+
/// .parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
12431243
/// .generate();
12441244
/// ```
12451245
#[derive(Debug)]

book/src/non-system-libraries.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ fn main() {
4848
// automatically know it must look for a `libhello.a` file.
4949
println!("cargo:rustc-link-lib=hello");
5050
51-
// Tell cargo to invalidate the built crate whenever the header changes.
52-
println!("cargo:rerun-if-changed={}", headers_path_str);
53-
5451
// Run `clang` to compile the `hello.c` file into a `hello.o` object file.
5552
// Unwrap if it is not possible to spawn the process.
5653
if !std::process::Command::new("clang")
@@ -91,7 +88,7 @@ fn main() {
9188
.header(headers_path_str)
9289
// Tell cargo to invalidate the built crate whenever any of the
9390
// included header files changed.
94-
.parse_callbacks(Box::new(CargoCallbacks))
91+
.parse_callbacks(Box::new(CargoCallbacks::new()))
9592
// Finish the builder and generate the bindings.
9693
.generate()
9794
// Unwrap the Result and panic on failure.

book/src/tutorial-3.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ fn main() {
2121
// shared library.
2222
println!("cargo:rustc-link-lib=bz2");
2323
24-
// Tell cargo to invalidate the built crate whenever the wrapper changes
25-
println!("cargo:rerun-if-changed=wrapper.h");
26-
2724
// The bindgen::Builder is the main entry point
2825
// to bindgen, and lets you build up options for
2926
// the resulting bindings.

0 commit comments

Comments
 (0)