mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-02-23 06:16:21 +00:00
Use unwrap_or_else() for the default value in the DateTime Display impl
This commit is contained in:
parent
05c51dd778
commit
ad7b21ba55
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ impl fmt::Display for DateTime {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str(
|
f.write_str(
|
||||||
self.to_iso8601_string()
|
self.to_iso8601_string()
|
||||||
.unwrap_or(String::from("None"))
|
.unwrap_or_else(|| String::from("None"))
|
||||||
.as_str(),
|
.as_str(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue