Implement the ToString trait for TimeVal instead of a custon function

This commit is contained in:
Rodolphe Breard 2019-07-11 23:32:47 +02:00
parent 9dbd90a083
commit d76d60650a

View file

@ -102,8 +102,8 @@ pub struct TimeVal {
pub usec: i64,
}
impl TimeVal {
pub fn to_string(&self) -> String {
impl ToString for TimeVal {
fn to_string(&self) -> String {
format!("{}.{}", self.sec, self.usec)
}
}