t_convert 1.0.0

A rust library which can take integer or floating point inputs, or parsed string inputs in order to convert temperature between the units of Celsius, Fahrenheit, and Kelvin.
Documentation
  • Coverage
  • 50%
    5 out of 10 items documented3 out of 6 items with examples
  • Size
  • Source code size: 5.51 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.48 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 30s Average build duration of successful builds.
  • all releases: 26s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Darethan026/t_convert
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Darethan026

t_convert

This is a rust library to convert temperatures between Celsius, Fahrenheit, and Kelvin.

To use it, copy and paste 'cargo add t_convert' on the command-line in the project directory and it will be added to your project.

Example

use t_convert::{Temperature, Unit};
use std::io;

fn main() {
	println!("Type in to convert from celsius to kelvin\n");
	
	let mut input = String::new();

	io::stdin().read_line(&mut input).expect("Failed to read line");

	match input.trim().parse::<f64>() {
		Ok(num) => {
			let temp = Temperature::new(num, Unit::Celsius);
			let temp = temp.to_kelvin();

			println!("\n{} degrees celsius is {} kelvin.", num, temp);
		}

		Err(e) => {
			println!("Error: ({})", e);
		}
	};
}

If you still aren't sure on how to use the library, refer to 'https://docs.rs/t_convert' to see the code.