17 releases

0.6.0 Oct 20, 2025
0.4.2 Dec 21, 2024
0.4.1 Aug 4, 2024
0.2.1 May 4, 2024
0.1.5 Nov 30, 2023

#1663 in Procedural macros

Download history 565933/week @ 2025-10-15 596076/week @ 2025-10-22 644848/week @ 2025-10-29 772598/week @ 2025-11-05 824247/week @ 2025-11-12 864078/week @ 2025-11-19 567371/week @ 2025-11-26 786236/week @ 2025-12-03 847954/week @ 2025-12-10 705953/week @ 2025-12-17 378498/week @ 2025-12-24 526260/week @ 2025-12-31 924299/week @ 2026-01-07 909385/week @ 2026-01-14 1100172/week @ 2026-01-21 887816/week @ 2026-01-28

3,968,392 downloads per month
Used in 631 crates (via equator)

MIT license

13KB
341 lines

equator

equator is an assertion library that aims to provide helpful diagnostics when multiple conditions need to be asserted at once, without short-circuiting.

Valid assertions must be of the form:

  • cond for testing a single condition,
  • all(...) for testing that multiple conditions all hold simultaneously,
  • any(...) for testing that at least one condition holds.

all and any may be arbitrarily nested.

Example

let x = 0;
let y = 1;

let a = 4;
let b = 2;

// `equator::debug_assert!` is also available for debug-only assertions
equator::assert!(all(x == y, a < b));

This should panic with an error message like

Assertion failed at path/main.rs:8:1
Assertion failed: x == y
- x = 0
- y = 1
Assertion failed: a < b
- a = 4
- b = 2

No runtime deps