Skip to content

Commit

Permalink
nlprule-build: validate must be the last step (#38)
Browse files Browse the repository at this point in the history
* validate must be the last step, there can not be a subsequent postprocess

Co-authored-by: Benjamin Minixhofer <bminixhofer@gmail.com>
  • Loading branch information
drahnr and bminixhofer authored Feb 20, 2021
1 parent 8be6fda commit aa4fa35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ impl BinaryBuilder {
}

/// Validates the binaries by checking if they can be loaded by nlprule.
pub fn validate(self) -> Result<Self> {
pub fn validate(&self) -> Result<()> {
for lang_code in &self.language_codes {
let tokenizer_out = self.out_dir.join(tokenizer_filename(lang_code));
let rules_out = self.out_dir.join(rules_filename(lang_code));
Expand All @@ -483,7 +483,7 @@ impl BinaryBuilder {
.map_err(|e| Error::ValidationFailed(lang_code.to_owned(), Binary::Tokenizer, e))?;
}

Ok(self)
Ok(())
}

/// Gets the paths to all files this builder created.
Expand Down

0 comments on commit aa4fa35

Please sign in to comment.