mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-09 03:48:05 +00:00
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:
parent
ca87aca1a6
commit
7257ee0397
@ -181,13 +181,13 @@ mod tests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToString for BufWriter {
|
impl std::fmt::Display for BufWriter {
|
||||||
fn to_string(&self) -> String {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
let data_ref = self.data.clone();
|
let data_ref = self.data.clone();
|
||||||
let output = data_ref.lock().unwrap();
|
let output = data_ref.lock().unwrap();
|
||||||
let s = (*output).clone();
|
let s = (*output).clone();
|
||||||
|
|
||||||
String::from_utf8(s).unwrap()
|
write!(f, "{}", String::from_utf8(s).unwrap())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user