Building the Rust Code
You can build the Rust code using the cargo command.
Run the following commands to verify the code before committing changes.
bash
cargo +nightly fmt && \
cargo clippy --all-targets --all-features && \
cargo build && \
env SAIL_UPDATE_GOLD_DATA=1 cargo testINFO
The code can be built and tested using the stable toolchain, while the nightly toolchain is required for formatting the code.
Please make sure there are no warnings in the output. The GitHub Actions workflow runs
cargo clippywith the-D warningsoption, so that the build will fail if there are any warnings from either the compiler or the linter.The
SAIL_UPDATE_GOLD_DATAenvironment variable update the test gold data files to match the behavior of the code. Runningcargo testwithout the environment variable will validate the gold data. The test would fail if the gold data is outdated.
