Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 769 Bytes

File metadata and controls

15 lines (13 loc) · 769 Bytes

Rust standards

Standards for Rust code in the Pyth Crosschain monorepo. The cross-cutting style.md, testing.md, and services.md also apply.

  • style.md — toolchain pinning, formatting (rustfmt, taplo), the clippy configuration, and the essential crates we standardize on.
  • idioms.md — avoiding panics, checked/saturating arithmetic, numeric conversions without as, and newtype IDs.
  • errors-and-logging.mdanyhow for services vs thiserror for libraries, preserving error sources, and structured logging with tracing.
  • testing.md — the cargo fmt / cargo clippy / cargo test gate and #[tokio::test] conventions.