-
Notifications
You must be signed in to change notification settings - Fork 0
kamadak/checked_ops-rs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Automatic checked arithmetic operations in Rust
-----------------------------------------------
Are you tired of writing checked arithmetic operations like this?
a.checked_add(b).and_then(|t| t.checked_mul(c))
The checked_ops crate to the rescue.
checked_ops!((a + b) * c)
Usage
-----
Add a dependency entry to your Cargo.toml.
[dependencies]
checked_ops = "0.1"
Import the macro into your source code.
use checked_ops::checked_ops;
Use the macro.
checked_ops!((a + b) * c)
Dependencies
------------
Rust 1.34 or later is required.
About
Automatic checked arithmetic operations in Rust
Topics
Resources
Stars
Watchers
Forks
Packages 0
No packages published