#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 174/week @ 2024-10-19 39/week @ 2024-10-26 6/week @ 2024-11-02 1/week @ 2024-11-09

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