#min-max #change #assign #operation

min_max_assign

Change min(max) implementation in Rust

2 stable releases

1.0.1 Oct 24, 2024

#516 in Math

Download history 208/week @ 2024-10-23 8/week @ 2024-10-30 4/week @ 2024-11-06

220 downloads per month

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