#min-max #change #assign #operation

min_max_assign

Change min(max) implementation in Rust

2 stable releases

1.0.1 Oct 24, 2024

#510 in Math

MIT/Apache

6KB
56 lines

Introduction

This crate provides "change min (max)" operation in Rust.

Installation

cargo add min_max_assign

License

MIT or Apache 2.0


lib.rs:

This crate provides "change min(max)" implementation in Rust.

Example

use min_max_assign::*;

let mut i = 100;
i.min_assign(10);
assert_eq!(i, 10);

let mut f = 10.0;
f.max_assign(100.0);
assert_eq!(f, 100.0)

No runtime deps