diff --git a/src/client/models.rs b/src/client/models.rs index aa560f9..e0ce547 100644 --- a/src/client/models.rs +++ b/src/client/models.rs @@ -71,15 +71,10 @@ pub struct RulesResponse { impl RulesResponse { /// Compile the rules from the response pub fn compile(&self) -> Result { - let rules_str = self - .rules - .values() - .map(String::as_ref) - .collect::>() - .join("\n"); - let mut compiler = yara_x::Compiler::new(); - compiler.add_source(rules_str.as_str())?; + for source in self.rules.values() { + compiler.add_source(source.as_str())?; + } Ok(compiler.build()) }