Fixed error in main example usage
This commit is contained in:
parent
9ae7047930
commit
9cbf5cbb83
@ -198,6 +198,7 @@ The compiled binaries will now be available inside `target/<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:
|
||||
|
||||
@ -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)
|
||||
//! }
|
||||
//! }
|
||||
//! ```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user