From 9cbf5cbb838c2ffa8f2f78f54e6dba0fc6d60a27 Mon Sep 17 00:00:00 2001 From: Kasper Date: Thu, 20 Aug 2020 22:10:07 +0200 Subject: [PATCH] Fixed error in main example usage --- README.md | 1 + src/lib.rs | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4be686c..f14abdc 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,7 @@ The compiled binaries will now be available inside `target//release/`. T 1. Update `CHANGELOG.md` 2. Bump the version number in `Cargo.toml` and run `cargo check` +3. Run `cargo test` 3. Cross-compile cpc by following [the steps above](#cross-compiling) 4. Commit and tag in format `v1.0.0` 5. Publish on crates.io: diff --git a/src/lib.rs b/src/lib.rs index 2aa8f6f..06718d4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,15 +8,16 @@ //! //! # Example usage //! ```rust -//! use cpc::{eval, Unit::*} +//! use cpc::{eval}; +//! use cpc::units::Unit; //! -//! match eval("3m + 1cm", true, Celcius) { +//! match eval("3m + 1cm", true, Unit::Celcius, false) { //! Ok(answer) => { -//! // answer: Number { value: 301, unit: Unit::cm } +//! // answer: Number { value: 301, unit: Unit::Centimeter } //! println!("Evaluated value: {} {:?}", answer.value, answer.unit) //! }, //! Err(e) => { -//! println!(e) +//! println!("{}", e) //! } //! } //! ```