diff --git a/crates/burrego/src/opa/builtins/regex.rs b/crates/burrego/src/opa/builtins/regex.rs index 50cd9955..8ec49b2f 100644 --- a/crates/burrego/src/opa/builtins/regex.rs +++ b/crates/burrego/src/opa/builtins/regex.rs @@ -1,6 +1,7 @@ use anyhow::{anyhow, Result}; use core::fmt::Display; use regex::{escape as regex_escape, Regex}; +use std::fmt::Write as _; // import without risk of name clashing use std::{fmt, str::FromStr}; pub fn split(args: &[serde_json::Value]) -> Result { @@ -117,7 +118,7 @@ impl Display for ExpressionList { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut result = String::new(); for expression in self.0.iter() { - result.push_str(&format!("{}", expression)); + write!(result, "{}", expression)?; } write!(f, "{}", result) }