diff --git a/src/agent/src/util.rs b/src/agent/src/util.rs index 60845a678e..49202c7413 100644 --- a/src/agent/src/util.rs +++ b/src/agent/src/util.rs @@ -181,13 +181,13 @@ mod tests { } } - impl ToString for BufWriter { - fn to_string(&self) -> String { + impl std::fmt::Display for BufWriter { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let data_ref = self.data.clone(); let output = data_ref.lock().unwrap(); let s = (*output).clone(); - String::from_utf8(s).unwrap() + write!(f, "{}", String::from_utf8(s).unwrap()) } }