xous-rs: Implement Display instead of Into

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
This commit is contained in:
Jean-Pierre De Jesus DIAZ 2022-10-12 15:34:45 +02:00
parent 5971507410
commit 3cbcf7b7e4
No known key found for this signature in database
GPG key ID: 6279AEC20A9524EC

View file

@ -12,13 +12,13 @@ impl ProcessKey {
}
}
impl Into<String> for ProcessKey {
fn into(self) -> String {
let mut out = String::new();
impl core::fmt::Display for ProcessKey {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
for i in self.0 {
out.push_str(&format!("{:02x}", i));
write!(f, "{:02x}", i)?;
}
out
Ok(())
}
}