Skip to content

Commit

Permalink
Use CargoCallbacks::new() in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
george-hopkins authored and emilio committed Jan 28, 2024
1 parent a8fa942 commit 6e133ba
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bindgen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ fn get_target_dependent_env_var(
/// use bindgen::builder;
/// let bindings = builder()
/// .header("path/to/input/header")
/// .parse_callbacks(Box::new(bindgen::CargoCallbacks))
/// .parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
/// .generate();
/// ```
#[derive(Debug)]
Expand Down
5 changes: 1 addition & 4 deletions book/src/non-system-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ fn main() {
// automatically know it must look for a `libhello.a` file.
println!("cargo:rustc-link-lib=hello");
// Tell cargo to invalidate the built crate whenever the header changes.
println!("cargo:rerun-if-changed={}", headers_path_str);
// Run `clang` to compile the `hello.c` file into a `hello.o` object file.
// Unwrap if it is not possible to spawn the process.
if !std::process::Command::new("clang")
Expand Down Expand Up @@ -91,7 +88,7 @@ fn main() {
.header(headers_path_str)
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
.parse_callbacks(Box::new(CargoCallbacks))
.parse_callbacks(Box::new(CargoCallbacks::new()))
// Finish the builder and generate the bindings.
.generate()
// Unwrap the Result and panic on failure.
Expand Down
3 changes: 0 additions & 3 deletions book/src/tutorial-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ fn main() {
// shared library.
println!("cargo:rustc-link-lib=bz2");
// Tell cargo to invalidate the built crate whenever the wrapper changes
println!("cargo:rerun-if-changed=wrapper.h");
// The bindgen::Builder is the main entry point
// to bindgen, and lets you build up options for
// the resulting bindings.
Expand Down

0 comments on commit 6e133ba

Please sign in to comment.