From 46d6f0616405f39f81a7b583d51798b34b05f7d4 Mon Sep 17 00:00:00 2001 From: yse Date: Fri, 22 Nov 2024 20:07:07 +0100 Subject: [PATCH] fix: add formatting command to build --- lib/core/build.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/core/build.rs b/lib/core/build.rs index 37bc80270..d93dbcb0e 100644 --- a/lib/core/build.rs +++ b/lib/core/build.rs @@ -1,6 +1,8 @@ use anyhow::*; use glob::glob; use std::env; +use std::os::unix::process::CommandExt as _; +use std::process::Command; use std::result::Result::Ok; /// Adds a temporary workaround for an issue with the Rust compiler and Android @@ -35,8 +37,13 @@ fn setup_x86_64_android_workaround() { fn compile_protos() -> Result<()> { tonic_build::configure() .build_server(false) - .out_dir("./src/sync/model") + .out_dir("src/sync/model") .compile_protos(&["src/sync/proto/sync.proto"], &["src/sync/proto"])?; + Command::new("rustfmt") + .arg("--edition") + .arg("2021") + .arg("src/sync/model/sync.rs") + .exec(); Ok(()) }