From d76d60650ae8b13f3f51a1490a08781c35dcca98 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Thu, 11 Jul 2019 23:32:47 +0200 Subject: [PATCH] Implement the ToString trait for TimeVal instead of a custon function --- opensmtpd/src/entry.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opensmtpd/src/entry.rs b/opensmtpd/src/entry.rs index f1701b4..736b818 100644 --- a/opensmtpd/src/entry.rs +++ b/opensmtpd/src/entry.rs @@ -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) } }