2 releases

new 0.1.1 Nov 15, 2024
0.1.0 Nov 15, 2024

#15 in #unit-conversion

Download history 202/week @ 2024-11-11

202 downloads per month

MIT license

15KB
343 lines

uCON

Unit conversion in Rust has never been easier.

Supported Conversions

  • Length
  • Weight
  • Temperature
  • Volume
  • Time
  • Speed
  • Area
  • Data

Usage

Add the following to your Cargo.toml:

[dependencies]
ucon = "0.1.0"

or add with cargo:

cargo add ucon
use ucon::Length;

fn main() {
    let meter = Length::Meter(1.0);
    let kilometer = meter.convert_to(&Length::Kilometer(0.0)).unwrap();
    println!("{} is {}", meter, kilometer);
}

No runtime deps