diff options
| author | Jokler <jokler@protonmail.com> | 2020-02-09 18:52:36 +0100 |
|---|---|---|
| committer | Jokler <jokler@protonmail.com> | 2020-02-22 23:20:10 +0100 |
| commit | 2273403d5f7c0e8994d7cefcfe641475e76f1d87 (patch) | |
| tree | 54fc210cc10e5e2a8adcdc1adbd46f22cb435dd8 /src/youtube_dl.rs | |
| parent | 84804836f5c1e782c77f1bbf676177151558e008 (diff) | |
| download | pokebot-2273403d5f7c0e8994d7cefcfe641475e76f1d87.tar.gz pokebot-2273403d5f7c0e8994d7cefcfe641475e76f1d87.zip | |
Split web_server module into separate components
Diffstat (limited to 'src/youtube_dl.rs')
| -rw-r--r-- | src/youtube_dl.rs | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/youtube_dl.rs b/src/youtube_dl.rs index 99e50e7..89b1477 100644 --- a/src/youtube_dl.rs +++ b/src/youtube_dl.rs @@ -15,22 +15,11 @@ pub struct AudioMetadata { pub title: String, pub thumbnail: Option<String>, #[serde(default, deserialize_with = "duration_deserialize")] - #[serde(serialize_with = "duration_serialize")] pub duration: Option<Duration>, #[serde(skip)] pub added_by: String, } -fn duration_serialize<S>(d: &Option<Duration>, s: S) -> Result<S::Ok, S::Error> -where - S: serde::Serializer, -{ - match d { - Some(d) => s.serialize_some(&d.as_secs_f64()), - None => s.serialize_none(), - } -} - fn duration_deserialize<'de, D>(deserializer: D) -> Result<Option<Duration>, D::Error> where D: serde::Deserializer<'de>, |
