Skip to content

Commit

Permalink
Fix visibility issue on abs_diff (#13)
Browse files Browse the repository at this point in the history
* reduce code with more macros

* Bump version

* formatting

* appeasing clippy

* fix visibility of abs_diff

* Bump package version
  • Loading branch information
0xPlish authored Apr 21, 2024
1 parent 3e597e1 commit 01b1360
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hylo-fix"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
description = "Fixed-point number types with Solana Anchor support"
authors = ["0xPlish <plish@hylo.so>", "Curtis McEnroe <programble@gmail.com>"]
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ where
Self: CheckedSub,
Bits: Copy,
{
fn abs_diff(&self, v: &Self) -> Fix<Bits, Base, Exp> {
#[must_use]
pub fn abs_diff(&self, v: &Self) -> Fix<Bits, Base, Exp> {
self.checked_sub(v).unwrap_or_else(|| *v - *self)
}
}
Expand Down

0 comments on commit 01b1360

Please sign in to comment.