Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error in build.rs from README.md #73

Closed
shybyte opened this issue Jun 6, 2021 · 3 comments · Fixed by #74
Closed

Compile error in build.rs from README.md #73

shybyte opened this issue Jun 6, 2021 · 3 comments · Fixed by #74

Comments

@shybyte
Copy link
Contributor

shybyte commented Jun 6, 2021

Using nlprule and nlprule-build version 0.6.4 and the build.rs script from the current README.md, I get a compile error while building:

error[E0599]: no method named `validate` found for enum `Result<BinaryBuilder, nlprule_build::Error>` in the current scope
 --> build.rs:9:6
  |
9 |     .validate();
  |      ^^^^^^^^ method not found in `Result<BinaryBuilder, nlprule_build::Error>`

I have solved it by adding error propagation to builds.rs:

fn main() -> Result<(), nlprule_build::Error> {
    println!("cargo:rerun-if-changed=build.rs");
    nlprule_build::BinaryBuilder::new(
        &["en"],
        std::env::var("OUT_DIR").expect("OUT_DIR is set when build.rs is running"),
    )
    .build()?
    .validate()
}

If you want, I can make a PR.

@bminixhofer
Copy link
Owner

Hi, thanks, good catch!

I'm hoping to remove some of this complexity soon (#72) which will make it easier to use.

Sure, a PR would be great. But if it's not convenient for you I can fix this myself later today.

shybyte added a commit to shybyte/nlprule that referenced this issue Jun 6, 2021
@shybyte
Copy link
Contributor Author

shybyte commented Jun 6, 2021

Probably it would be easier for you to just fix this problem yourself, but I'm keen to contribute to your cool project. 😃

bminixhofer pushed a commit that referenced this issue Jun 7, 2021
@bminixhofer
Copy link
Owner

It would've probably taken roughly the same time, and there's certainly some symbolic value :) Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants