2 releases

0.1.1 Nov 15, 2024
0.1.0 Nov 15, 2024

#15 in #weight

Download history 202/week @ 2024-11-11 33/week @ 2024-11-18 11/week @ 2024-12-02 20/week @ 2024-12-09

79 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