mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-17 16:42:28 +00:00
fix link fields
This commit is contained in:
1 parent
42a55e6759
commit
83b76bb838
14 files changed
+345
-79
No files matched your search
@@ -266,7 +266,10 @@ mod tests {
|
||||
name: Some("summit".into()),
|
||||
cmt: Some("comment".into()),
|
||||
desc: Some("description".into()),
|
||||
link: Some(link("https://example.com/summit")),
|
||||
links: vec![
|
||||
link("https://example.com/summit"),
|
||||
link("https://example.com/summit-2"),
|
||||
],
|
||||
sym: Some("Summit".into()),
|
||||
type_: Some("peak".into()),
|
||||
}
|
||||
@@ -284,7 +287,10 @@ mod tests {
|
||||
email: Some("someone@example.com".into()),
|
||||
link: Some(link("https://example.com/someone")),
|
||||
}),
|
||||
link: Some(link("https://example.com/file")),
|
||||
links: vec![
|
||||
link("https://example.com/file"),
|
||||
link("https://example.com/file-2"),
|
||||
],
|
||||
time: Some(1_700_000_000_000),
|
||||
},
|
||||
..Default::default()
|
||||
@@ -304,7 +310,10 @@ mod tests {
|
||||
cmt: Some("cmt".into()),
|
||||
desc: Some("desc".into()),
|
||||
src: Some("src".into()),
|
||||
link: Some(link("https://example.com/track")),
|
||||
links: vec![
|
||||
link("https://example.com/track"),
|
||||
link("https://example.com/track-2"),
|
||||
],
|
||||
type_: Some("Cycling".into()),
|
||||
color: Some("ff0000".into()),
|
||||
opacity: Some(0.5),
|
||||
@@ -508,13 +517,16 @@ mod tests {
|
||||
const FILE_V1: &str = concat!(
|
||||
"010673616d706c65010561626f7574010107736f6d656f6e650113736f6d656f6e65406578616d706c652e63",
|
||||
"6f6d011b68747470733a2f2f6578616d706c652e636f6d2f736f6d656f6e65012374657874206f6620687474",
|
||||
"70733a2f2f6578616d706c652e636f6d2f736f6d656f6e65011868747470733a2f2f6578616d706c652e636f",
|
||||
"6d2f66696c65012074657874206f662068747470733a2f2f6578616d706c652e636f6d2f66696c650180a0ab",
|
||||
"fef9620110000000000000000000000000000000020105747261636b0103636d740104646573630103737263",
|
||||
"011968747470733a2f2f6578616d706c652e636f6d2f747261636b012174657874206f662068747470733a2f",
|
||||
"2f6578616d706c652e636f6d2f747261636b01074379636c696e67010666663030303001000000000000e03f",
|
||||
"0100000000000018400210000000000000000000000000000000030110000000000000000000000000000000",
|
||||
"04100000000000000000000000000000000600011000000000000000000000000000000005",
|
||||
"70733a2f2f6578616d706c652e636f6d2f736f6d656f6e65021868747470733a2f2f6578616d706c652e636f",
|
||||
"6d2f66696c65012074657874206f662068747470733a2f2f6578616d706c652e636f6d2f66696c651a687474",
|
||||
"70733a2f2f6578616d706c652e636f6d2f66696c652d32012274657874206f662068747470733a2f2f657861",
|
||||
"6d706c652e636f6d2f66696c652d320180a0abfef96201100000000000000000000000000000000201057472",
|
||||
"61636b0103636d740104646573630103737263021968747470733a2f2f6578616d706c652e636f6d2f747261",
|
||||
"636b012174657874206f662068747470733a2f2f6578616d706c652e636f6d2f747261636b1b68747470733a",
|
||||
"2f2f6578616d706c652e636f6d2f747261636b2d32012374657874206f662068747470733a2f2f6578616d70",
|
||||
"6c652e636f6d2f747261636b2d3201074379636c696e67010666663030303001000000000000e03f01000000",
|
||||
"0000001840021000000000000000000000000000000003011000000000000000000000000000000004100000",
|
||||
"000000000000000000000000000600011000000000000000000000000000000005",
|
||||
);
|
||||
const TRACKPOINTS_V1: &str = concat!(
|
||||
"01030000000000001040000000000000494000000000002059400180a0abfef9620105018c01015001fa0101",
|
||||
@@ -524,10 +536,12 @@ mod tests {
|
||||
);
|
||||
const WAYPOINTS_V1: &str = concat!(
|
||||
"0102100000000000000000000000000000000700000000000016400000000000c04940000000000010744001",
|
||||
"80a0abfef962010673756d6d69740107636f6d6d656e74010b6465736372697074696f6e011a68747470733a",
|
||||
"80a0abfef962010673756d6d69740107636f6d6d656e74010b6465736372697074696f6e021a68747470733a",
|
||||
"2f2f6578616d706c652e636f6d2f73756d6d6974012274657874206f662068747470733a2f2f6578616d706c",
|
||||
"652e636f6d2f73756d6d6974010653756d6d697401047065616b100000000000000000000000000000000800",
|
||||
"000000000000000000000000000000000000000000000000000000000000",
|
||||
"652e636f6d2f73756d6d69741c68747470733a2f2f6578616d706c652e636f6d2f73756d6d69742d32012474",
|
||||
"657874206f662068747470733a2f2f6578616d706c652e636f6d2f73756d6d69742d32010653756d6d697401",
|
||||
"047065616b100000000000000000000000000000000800000000000000000000000000000000000000000000",
|
||||
"000000000000000000",
|
||||
);
|
||||
const ORDER_V1: &str =
|
||||
"010210000000000000000000000000000000091000000000000000000000000000000008";
|
||||
|
||||
@@ -46,7 +46,7 @@ pub struct FileInfo1 {
|
||||
name: String,
|
||||
desc: Option<String>,
|
||||
author: Option<Author1>,
|
||||
link: Option<Link1>,
|
||||
links: Vec<Link1>,
|
||||
time: Option<i64>,
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ impl From<&FileInfo> for FileInfo1 {
|
||||
email: author.email.clone(),
|
||||
link: author.link.as_ref().map(Into::into),
|
||||
}),
|
||||
link: info.link.as_ref().map(Into::into),
|
||||
links: info.links.iter().map(Into::into).collect(),
|
||||
time: info.time,
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ impl From<FileInfo1> for FileInfo {
|
||||
email: author.email,
|
||||
link: author.link.map(Into::into),
|
||||
}),
|
||||
link: info.link.map(Into::into),
|
||||
links: info.links.into_iter().map(Into::into).collect(),
|
||||
time: info.time,
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ pub struct TrackInfo1 {
|
||||
cmt: Option<String>,
|
||||
desc: Option<String>,
|
||||
src: Option<String>,
|
||||
link: Option<Link1>,
|
||||
links: Vec<Link1>,
|
||||
type_: Option<String>,
|
||||
color: Option<String>,
|
||||
opacity: Option<f64>,
|
||||
@@ -102,7 +102,7 @@ impl From<&TrackInfo> for TrackInfo1 {
|
||||
cmt: info.cmt.clone(),
|
||||
desc: info.desc.clone(),
|
||||
src: info.src.clone(),
|
||||
link: info.link.as_ref().map(Into::into),
|
||||
links: info.links.iter().map(Into::into).collect(),
|
||||
type_: info.type_.clone(),
|
||||
color: info.color.clone(),
|
||||
opacity: info.opacity,
|
||||
@@ -118,7 +118,7 @@ impl From<TrackInfo1> for TrackInfo {
|
||||
cmt: info.cmt,
|
||||
desc: info.desc,
|
||||
src: info.src,
|
||||
link: info.link.map(Into::into),
|
||||
links: info.links.into_iter().map(Into::into).collect(),
|
||||
type_: info.type_,
|
||||
color: info.color,
|
||||
opacity: info.opacity,
|
||||
@@ -242,7 +242,7 @@ pub struct Waypoint1 {
|
||||
name: Option<String>,
|
||||
cmt: Option<String>,
|
||||
desc: Option<String>,
|
||||
link: Option<Link1>,
|
||||
links: Vec<Link1>,
|
||||
sym: Option<String>,
|
||||
type_: Option<String>,
|
||||
}
|
||||
@@ -258,7 +258,7 @@ impl From<&Waypoint> for Waypoint1 {
|
||||
name: waypoint.name.clone(),
|
||||
cmt: waypoint.cmt.clone(),
|
||||
desc: waypoint.desc.clone(),
|
||||
link: waypoint.link.as_ref().map(Into::into),
|
||||
links: waypoint.links.iter().map(Into::into).collect(),
|
||||
sym: waypoint.sym.clone(),
|
||||
type_: waypoint.type_.clone(),
|
||||
}
|
||||
@@ -278,7 +278,7 @@ impl From<Waypoint1> for Waypoint {
|
||||
name: waypoint.name,
|
||||
cmt: waypoint.cmt,
|
||||
desc: waypoint.desc,
|
||||
link: waypoint.link.map(Into::into),
|
||||
links: waypoint.links.into_iter().map(Into::into).collect(),
|
||||
sym: waypoint.sym,
|
||||
type_: waypoint.type_,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user