From 16c4c5b0b08f1929650eb086726b511d2a136422 Mon Sep 17 00:00:00 2001 From: Yifan Song Date: Fri, 13 Dec 2024 20:17:25 +0100 Subject: [PATCH] format --- crates/typst-preview/src/actor/typst.rs | 14 +++++++++----- crates/typst-preview/src/actor/webview.rs | 5 +---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/crates/typst-preview/src/actor/typst.rs b/crates/typst-preview/src/actor/typst.rs index ef68840ac..95bf09f40 100644 --- a/crates/typst-preview/src/actor/typst.rs +++ b/crates/typst-preview/src/actor/typst.rs @@ -121,11 +121,15 @@ impl TypstActor { if let Some(info) = res { let _ = self .webview_conn_sender - .send(WebviewActorRequest::SrcToDocJump(info.into_iter().map(|info| DocumentPosition { - page_no: info.page.into(), - x: info.point.x.to_pt() as f32, - y: info.point.y.to_pt() as f32, - }).collect())); + .send(WebviewActorRequest::SrcToDocJump( + info.into_iter() + .map(|info| DocumentPosition { + page_no: info.page.into(), + x: info.point.x.to_pt() as f32, + y: info.point.y.to_pt() as f32, + }) + .collect(), + )); } } TypstActorRequest::SyncMemoryFiles(m) => { diff --git a/crates/typst-preview/src/actor/webview.rs b/crates/typst-preview/src/actor/webview.rs index ea8d9064e..4f4bc47b7 100644 --- a/crates/typst-preview/src/actor/webview.rs +++ b/crates/typst-preview/src/actor/webview.rs @@ -29,10 +29,7 @@ fn position_req( format!("{event},{page_no} {x} {y}") } -fn positions_req( - event: &'static str, - positions: Vec, -) -> String { +fn positions_req(event: &'static str, positions: Vec) -> String { format!("{event},") + &positions .iter()