Skip to content

Commit 57cb606

Browse files
committed
comment build.rs file
1 parent 770c987 commit 57cb606

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lazer/sdk/rust/protocol/build.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
use std::io::Result;
22

3+
/// Automatically runs during cargo build.
4+
/// Proto files for Lazer are defined in the lazer sdk folder in the proto/ subdirectory.
5+
/// Both JS and Rust SDKs read the proto files for generating types.
36
fn main() -> Result<()> {
7+
// Tell cargo to recompile if any .proto files change
8+
println!("cargo:rerun-if-changed=proto/");
9+
10+
// Selects proto files to be read for compiling
411
let proto_files = vec![
512
"../../proto/pyth_lazer_transaction.proto",
613
"../../proto/publisher_update.proto",
714
];
815

9-
prost_build::compile_protos(&proto_files, &["../../proto"])?;
16+
// Compiles protos and generates Rust types
17+
// Generated types are present in the output folder
18+
prost_build::compile_protos(&proto_files, &["../../proto"])
19+
.expect("Failed to compile protos and generate types");
1020

1121
Ok(())
1222
}

0 commit comments

Comments
 (0)