agent: Remove implementation of ToString

Fix clippy error:
```
direct implementation of `ToString`
```
by switching to implement Display instead

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
stevenhorsman 2025-01-28 16:12:53 +00:00
parent ca87aca1a6
commit 7257ee0397

View File

@ -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())
}
}