summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikuroXina <ryosukadnak@gmail.com>2021-12-04 16:56:05 +0900
committerEmilio Cobos Álvarez <emilio@crisal.io>2021-12-29 20:39:01 +0100
commit66cc4598e4ca760db17ddbdf5202b3e20f8e5ae9 (patch)
treeeded56ea5d87d4e9c6d59d49f17d35f547249270
parentc97169673b2371ae1791fb41c9d30372796b59bf (diff)
Replace generate with gen in test
-rw-r--r--.github/ISSUE_TEMPLATE.md2
-rw-r--r--bindgen-integration/build.rs2
-rw-r--r--book/src/tutorial-3.md2
-rw-r--r--src/lib.rs10
-rw-r--r--src/main.rs4
-rwxr-xr-xtests/stylo_sanity.rs2
-rw-r--r--tests/tests.rs18
7 files changed, 20 insertions, 20 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index 442e0786..86785dbb 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -24,7 +24,7 @@
```Rust
bindgen::Builder::default()
.header("input.h")
- .generate()
+ .gen()
.unwrap()
```
diff --git a/bindgen-integration/build.rs b/bindgen-integration/build.rs
index 77ea64b5..76778379 100644
--- a/bindgen-integration/build.rs
+++ b/bindgen-integration/build.rs
@@ -185,7 +185,7 @@ fn main() {
.constified_enum("my_prefixed_enum_to_be_constified")
.opaque_type("my_prefixed_templated_foo<my_prefixed_baz>")
.depfile(out_rust_file_relative.display().to_string(), &out_dep_file)
- .generate()
+ .gen()
.expect("Unable to generate bindings");
assert!(macros.read().unwrap().contains("TESTMACRO"));
diff --git a/book/src/tutorial-3.md b/book/src/tutorial-3.md
index 139a24f9..d4152ca2 100644
--- a/book/src/tutorial-3.md
+++ b/book/src/tutorial-3.md
@@ -32,7 +32,7 @@ fn main() {
// included header files changed.
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
// Finish the builder and generate the bindings.
- .generate()
+ .gen()
// Unwrap the Result and panic on failure.
.expect("Unable to generate bindings");
diff --git a/src/lib.rs b/src/lib.rs
index 76841427..01fd027f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -180,7 +180,7 @@ impl Default for CodegenConfig {
/// let bindings = builder().header("path/to/input/header")
/// .allowlist_type("SomeCoolClass")
/// .allowlist_function("do_some_cool_thing")
-/// .generate()?;
+/// .gen()?;
///
/// // Write the generated bindings to an output file.
/// bindings.write_to_file("path/to/output.rs")?;
@@ -247,7 +247,7 @@ impl Builder {
// FIXME(emilio): This is a bit hacky, maybe we should stop re-using the
// RustFeatures to store the "disable_untagged_union" call, and make it
- // a different flag that we check elsewhere / in generate().
+ // a different flag that we check elsewhere / in gen().
if !self.options.rust_features.untagged_union &&
RustFeatures::from(self.options.rust_target).untagged_union
{
@@ -595,7 +595,7 @@ impl Builder {
/// ```ignore
/// let bindings = bindgen::Builder::default()
/// .header("input.h")
- /// .generate()
+ /// .gen()
/// .unwrap();
/// ```
///
@@ -607,7 +607,7 @@ impl Builder {
/// .header("first.h")
/// .header("second.h")
/// .header("third.h")
- /// .generate()
+ /// .gen()
/// .unwrap();
/// ```
pub fn header<T: Into<String>>(mut self, header: T) -> Builder {
@@ -2726,7 +2726,7 @@ fn get_target_dependent_env_var(var: &str) -> Option<String> {
/// let bindings = builder()
/// .header("path/to/input/header")
/// .parse_callbacks(Box::new(bindgen::CargoCallbacks))
-/// .generate();
+/// .gen();
/// ```
#[derive(Debug)]
pub struct CargoCallbacks;
diff --git a/src/main.rs b/src/main.rs
index f3398db8..d8472fdb 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -49,7 +49,7 @@ pub fn main() {
Ok((builder, output, verbose)) => {
clang_version_check();
let builder_result = panic::catch_unwind(|| {
- builder.generate().expect("Unable to generate bindings")
+ builder.gen().expect("Unable to generate bindings")
});
if builder_result.is_err() {
@@ -99,7 +99,7 @@ mod test {
let (builder, _output, _verbose) =
crate::options::builder_from_flags(command_line_flags.into_iter())
.unwrap();
- builder.generate().expect("failed to generate bindings");
+ builder.gen().expect("failed to generate bindings");
}
#[test]
diff --git a/tests/stylo_sanity.rs b/tests/stylo_sanity.rs
index 39777cd1..93b11473 100755
--- a/tests/stylo_sanity.rs
+++ b/tests/stylo_sanity.rs
@@ -540,7 +540,7 @@ fn sanity_check_can_generate_stylo_bindings() {
.clang_arg("-DMOZ_STYLO")
.clang_arg("-DOS_POSIX=1")
.clang_arg("-DOS_LINUX=1")
- .generate()
+ .gen()
.expect("Should generate stylo bindings");
let now = Instant::now();
diff --git a/tests/tests.rs b/tests/tests.rs
index a62fe42f..08781d46 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -193,13 +193,13 @@ fn compare_generated_header(
let (builder, roundtrip_builder) = builder.into_builder(check_roundtrip)?;
- // We skip the generate() error here so we get a full diff below
- let (actual, rustfmt_stderr) = match builder.generate() {
+ // We skip the gen() error here so we get a full diff below
+ let (actual, rustfmt_stderr) = match builder.gen() {
Ok(bindings) => {
let actual = bindings.to_string();
rustfmt(actual)
}
- Err(()) => ("<error generating bindings>".to_string(), "".to_string()),
+ Err(_) => ("<error generating bindings>".to_string(), "".to_string()),
};
println!("{}", rustfmt_stderr);
@@ -426,7 +426,7 @@ fn test_clang_env_args() {
#ifdef _ENV_TWO\nextern const int y[] = { 42 };\n#endif\n\
#ifdef NOT_THREE\nextern const int z[] = { 42 };\n#endif\n",
)
- .generate()
+ .gen()
.unwrap()
.to_string();
@@ -453,7 +453,7 @@ fn test_header_contents() {
.disable_header_comment()
.header_contents("test.h", "int foo(const char* a);")
.clang_arg("--target=x86_64-unknown-linux")
- .generate()
+ .gen()
.unwrap()
.to_string();
@@ -480,7 +480,7 @@ fn test_multiple_header_calls_in_builder() {
))
.header(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/headers/char.h"))
.clang_arg("--target=x86_64-unknown-linux")
- .generate()
+ .gen()
.unwrap()
.to_string();
@@ -514,7 +514,7 @@ fn test_multiple_header_contents() {
.header_contents("test.h", "int foo(const char* a);")
.header_contents("test2.h", "float foo2(const char* b);")
.clang_arg("--target=x86_64-unknown-linux")
- .generate()
+ .gen()
.unwrap()
.to_string();
@@ -546,7 +546,7 @@ fn test_mixed_header_and_header_contents() {
.header_contents("test.h", "int bar(const char* a);")
.header_contents("test2.h", "float bar2(const char* b);")
.clang_arg("--target=x86_64-unknown-linux")
- .generate()
+ .gen()
.unwrap()
.to_string();
@@ -596,7 +596,7 @@ fn emit_depfile() {
env::var_os("BINDGEN_DISABLE_ROUNDTRIP_TEST").is_none();
let (builder, _roundtrip_builder) =
builder.into_builder(check_roundtrip).unwrap();
- let _bindings = builder.generate().unwrap();
+ let _bindings = builder.gen().unwrap();
let observed = std::fs::read_to_string(observed_depfile).unwrap();
let expected = std::fs::read_to_string(expected_depfile).unwrap();