v1.0.2
This commit is contained in:
parent
bb4bdb72f1
commit
5f85d32f65
@ -1,3 +1,7 @@
|
|||||||
|
## 1.0.2 - 2020 Oct 12
|
||||||
|
- Fix parsing of unit `Quarter` (#1)
|
||||||
|
- Use division instead of multiplication when dividing numbers of the same unit `Quarter` (#1)
|
||||||
|
|
||||||
## 1.0.1 - 2020 Aug 20
|
## 1.0.1 - 2020 Aug 20
|
||||||
- Fixed the library not working
|
- Fixed the library not working
|
||||||
- Added documentation comments
|
- Added documentation comments
|
||||||
|
|||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -12,7 +12,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cpc"
|
name = "cpc"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"decimal 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"decimal 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cpc"
|
name = "cpc"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
description = "evaluates math expressions, with support for units and conversion between units"
|
description = "evaluates math expressions, with support for units and conversion between units"
|
||||||
authors = ["Kasper Henningsen"]
|
authors = ["Kasper Henningsen"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@ -200,9 +200,9 @@ The compiled binaries will now be available inside `target/<target>/release/`. T
|
|||||||
1. Update `CHANGELOG.md`
|
1. Update `CHANGELOG.md`
|
||||||
2. Bump the version number in `Cargo.toml` and run `cargo check`
|
2. Bump the version number in `Cargo.toml` and run `cargo check`
|
||||||
3. Run `cargo test`
|
3. Run `cargo test`
|
||||||
3. Cross-compile cpc by following [the steps above](#cross-compiling)
|
4. Cross-compile cpc by following [the steps above](#cross-compiling)
|
||||||
4. Commit and tag in format `v1.0.0`
|
5. Commit and tag in format `v0.0.0`
|
||||||
5. Publish on crates.io:
|
6. Publish on crates.io:
|
||||||
1. Login by running `cargo login` and following the instructions
|
1. Login by running `cargo login` and following the instructions
|
||||||
2. Test publish to ensure there are no issues
|
2. Test publish to ensure there are no issues
|
||||||
```
|
```
|
||||||
@ -212,6 +212,6 @@ The compiled binaries will now be available inside `target/<target>/release/`. T
|
|||||||
```
|
```
|
||||||
cargo publish
|
cargo publish
|
||||||
```
|
```
|
||||||
6. Publish on GitHub
|
7. Publish on GitHub
|
||||||
1. Zip the binaries and rename them like `cpc-v1.0.0-darwin-x64`
|
1. Zip the binaries and rename them like `cpc-v1.0.0-darwin-x64`
|
||||||
2. Create GitHub release with release notes and attach the zipped binaries
|
2. Create GitHub release with release notes and attach the zipped binaries
|
||||||
|
|||||||
@ -420,7 +420,7 @@ pub fn divide(left: Number, right: Number) -> Result<Number, String> {
|
|||||||
// 1 km / 2
|
// 1 km / 2
|
||||||
Ok(Number::new(left.value / right.value, right.unit))
|
Ok(Number::new(left.value / right.value, right.unit))
|
||||||
} else if lcat == rcat {
|
} else if lcat == rcat {
|
||||||
// 1 km / 1 km
|
// 4 km / 2 km
|
||||||
let (left, right) = convert_to_lowest(left, right)?;
|
let (left, right) = convert_to_lowest(left, right)?;
|
||||||
Ok(Number::new(left.value / right.value, NoUnit))
|
Ok(Number::new(left.value / right.value, NoUnit))
|
||||||
} else if (lcat == Area && rcat == Length) || (lcat == Volume && rcat == Area) {
|
} else if (lcat == Area && rcat == Length) || (lcat == Volume && rcat == Area) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user