New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

equator

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

equator

Source
crates.io
Version
0.4.2
Version published
Weekly downloads
2.5M
6.06%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 21 Dec 2024

Related posts