From ad7b21ba55a97988909cf5e07f2e70fbee8108e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 5 Dec 2017 23:20:10 +0200 Subject: [PATCH] Use unwrap_or_else() for the default value in the DateTime Display impl --- gstreamer/src/date_time.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gstreamer/src/date_time.rs b/gstreamer/src/date_time.rs index 62419fd53..c46d2dfad 100644 --- a/gstreamer/src/date_time.rs +++ b/gstreamer/src/date_time.rs @@ -13,7 +13,7 @@ impl fmt::Display for DateTime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str( self.to_iso8601_string() - .unwrap_or(String::from("None")) + .unwrap_or_else(|| String::from("None")) .as_str(), ) }