merge methods into 1

This commit is contained in:
vcoppe
2026-10-03 17:47:04 +02:00
parent 891a08a3cc
commit 639e7491eb
5 changed files with 14 additions and 38 deletions
+2 -7
View File
@@ -182,15 +182,10 @@ pub fn reverse() -> bool {
}
#[wasm_bindgen]
pub fn append(lng: &[f64], lat: &[f64], ele: &[f64]) -> bool {
same_len(lng, lat, ele) && edit(Command::Append(engine::Append { lng, lat, ele }))
}
#[wasm_bindgen]
pub fn replace(start: u32, end: u32, lng: &[f64], lat: &[f64], ele: &[f64]) -> bool {
pub fn splice_trackpoints(start: u32, end: u32, lng: &[f64], lat: &[f64], ele: &[f64]) -> bool {
start <= end
&& same_len(lng, lat, ele)
&& edit(Command::Replace(engine::Replace {
&& edit(Command::SpliceTrackpoints(engine::SpliceTrackpoints {
start,
end,
lng,