forked from mirrors/gstreamer-rs
Toc: serde: rename loop_
to loop
This commit is contained in:
parent
0aac055727
commit
d4fb10ef4c
1 changed files with 14 additions and 13 deletions
|
@ -38,7 +38,7 @@ impl Serialize for TocEntryRef {
|
||||||
toc_entry.serialize_field("uid", &self.get_uid())?;
|
toc_entry.serialize_field("uid", &self.get_uid())?;
|
||||||
toc_entry.serialize_field("start_stop", &self.get_start_stop_times())?;
|
toc_entry.serialize_field("start_stop", &self.get_start_stop_times())?;
|
||||||
toc_entry.serialize_field("tags", &self.get_tags())?;
|
toc_entry.serialize_field("tags", &self.get_tags())?;
|
||||||
toc_entry.serialize_field("loop_", &self.get_loop())?;
|
toc_entry.serialize_field("loop", &self.get_loop())?;
|
||||||
toc_entry.serialize_field("sub_entries", &self.get_sub_entries())?;
|
toc_entry.serialize_field("sub_entries", &self.get_sub_entries())?;
|
||||||
toc_entry.end()
|
toc_entry.end()
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ impl From<TocDe> for Toc {
|
||||||
impl<'de> Deserialize<'de> for Toc {
|
impl<'de> Deserialize<'de> for Toc {
|
||||||
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
|
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
|
||||||
TocDe::deserialize(deserializer)
|
TocDe::deserialize(deserializer)
|
||||||
.and_then(|toc_de| Ok(toc_de.into()))
|
.map(|toc_de| toc_de.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,6 +87,7 @@ struct TocEntryDe {
|
||||||
uid: String,
|
uid: String,
|
||||||
start_stop: Option<(i64, i64)>,
|
start_stop: Option<(i64, i64)>,
|
||||||
tags: Option<TagList>,
|
tags: Option<TagList>,
|
||||||
|
#[serde(rename = "loop")]
|
||||||
loop_: Option<(TocLoopType, i32)>,
|
loop_: Option<(TocLoopType, i32)>,
|
||||||
sub_entries: Vec<TocEntry>,
|
sub_entries: Vec<TocEntry>,
|
||||||
}
|
}
|
||||||
|
@ -118,7 +119,7 @@ impl From<TocEntryDe> for TocEntry {
|
||||||
impl<'de> Deserialize<'de> for TocEntry {
|
impl<'de> Deserialize<'de> for TocEntry {
|
||||||
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
|
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
|
||||||
TocEntryDe::deserialize(deserializer)
|
TocEntryDe::deserialize(deserializer)
|
||||||
.and_then(|toc_entry_de| Ok(toc_entry_de.into()))
|
.map(|toc_entry_de| toc_entry_de.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,14 +210,14 @@ mod tests {
|
||||||
" uid: \"edition\",",
|
" uid: \"edition\",",
|
||||||
" start_stop: Some((0, 15)),",
|
" start_stop: Some((0, 15)),",
|
||||||
" tags: None,",
|
" tags: None,",
|
||||||
" loop_: Some((None, 0)),",
|
" loop: Some((None, 0)),",
|
||||||
" sub_entries: [",
|
" sub_entries: [",
|
||||||
" (",
|
" (",
|
||||||
" entry_type: Chapter,",
|
" entry_type: Chapter,",
|
||||||
" uid: \"chapter1\",",
|
" uid: \"chapter1\",",
|
||||||
" start_stop: Some((0, 10)),",
|
" start_stop: Some((0, 10)),",
|
||||||
" tags: None,",
|
" tags: None,",
|
||||||
" loop_: Some((None, 0)),",
|
" loop: Some((None, 0)),",
|
||||||
" sub_entries: [",
|
" sub_entries: [",
|
||||||
" (",
|
" (",
|
||||||
" entry_type: Chapter,",
|
" entry_type: Chapter,",
|
||||||
|
@ -227,7 +228,7 @@ mod tests {
|
||||||
" \"chapter 1.1\",",
|
" \"chapter 1.1\",",
|
||||||
" ]),",
|
" ]),",
|
||||||
" ]),",
|
" ]),",
|
||||||
" loop_: Some((None, 0)),",
|
" loop: Some((None, 0)),",
|
||||||
" sub_entries: [",
|
" sub_entries: [",
|
||||||
" ],",
|
" ],",
|
||||||
" ),",
|
" ),",
|
||||||
|
@ -240,7 +241,7 @@ mod tests {
|
||||||
" \"chapter 1.2\",",
|
" \"chapter 1.2\",",
|
||||||
" ]),",
|
" ]),",
|
||||||
" ]),",
|
" ]),",
|
||||||
" loop_: Some((None, 0)),",
|
" loop: Some((None, 0)),",
|
||||||
" sub_entries: [",
|
" sub_entries: [",
|
||||||
" ],",
|
" ],",
|
||||||
" ),",
|
" ),",
|
||||||
|
@ -255,7 +256,7 @@ mod tests {
|
||||||
" \"chapter 2\",",
|
" \"chapter 2\",",
|
||||||
" ]),",
|
" ]),",
|
||||||
" ]),",
|
" ]),",
|
||||||
" loop_: Some((None, 0)),",
|
" loop: Some((None, 0)),",
|
||||||
" sub_entries: [",
|
" sub_entries: [",
|
||||||
" ],",
|
" ],",
|
||||||
" ),",
|
" ),",
|
||||||
|
@ -287,14 +288,14 @@ mod tests {
|
||||||
uid: "edition",
|
uid: "edition",
|
||||||
start_stop: Some((0, 15)),
|
start_stop: Some((0, 15)),
|
||||||
tags: None,
|
tags: None,
|
||||||
loop_: Some((None, 0)),
|
loop: Some((None, 0)),
|
||||||
sub_entries: [
|
sub_entries: [
|
||||||
(
|
(
|
||||||
entry_type: Chapter,
|
entry_type: Chapter,
|
||||||
uid: "chapter1",
|
uid: "chapter1",
|
||||||
start_stop: Some((0, 10)),
|
start_stop: Some((0, 10)),
|
||||||
tags: None,
|
tags: None,
|
||||||
loop_: Some((None, 0)),
|
loop: Some((None, 0)),
|
||||||
sub_entries: [
|
sub_entries: [
|
||||||
(
|
(
|
||||||
entry_type: Chapter,
|
entry_type: Chapter,
|
||||||
|
@ -303,7 +304,7 @@ mod tests {
|
||||||
tags: Some([
|
tags: Some([
|
||||||
("title", ["chapter 1.1"]),
|
("title", ["chapter 1.1"]),
|
||||||
]),
|
]),
|
||||||
loop_: Some((None, 0)),
|
loop: Some((None, 0)),
|
||||||
sub_entries: [
|
sub_entries: [
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -314,7 +315,7 @@ mod tests {
|
||||||
tags: Some([
|
tags: Some([
|
||||||
("title", ["chapter 1.2"]),
|
("title", ["chapter 1.2"]),
|
||||||
]),
|
]),
|
||||||
loop_: Some((None, 0)),
|
loop: Some((None, 0)),
|
||||||
sub_entries: [
|
sub_entries: [
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -327,7 +328,7 @@ mod tests {
|
||||||
tags: Some([
|
tags: Some([
|
||||||
("title", ["chapter 2"]),
|
("title", ["chapter 2"]),
|
||||||
]),
|
]),
|
||||||
loop_: Some((None, 0)),
|
loop: Some((None, 0)),
|
||||||
sub_entries: [
|
sub_entries: [
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue