Skip to content

Commit

Permalink
Removed impl self refrences and replaced with Self
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-jay-amin committed May 29, 2024
1 parent 8eacc2b commit 0c47cf6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scarb 2.6.3
2 changes: 1 addition & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "cubit"
version = "1.3.0"
cairo-version = ">=2.4.0"
cairo-version = ">=2.6.0"
edition = "2023_10"
description = "Math library in Cairo using a 64.64 fixed point representation"
homepage = "https://github.com/influenceth/cubit"
Expand Down
8 changes: 4 additions & 4 deletions src/f128/types/fixed.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ impl FixedImpl of FixedTrait {
}

fn new_unscaled(mag: u128, sign: bool) -> Fixed {
return FixedTrait::new(mag * ONE_u128, sign);
return Self::new(mag * ONE_u128, sign);
}

fn from_felt(val: felt252) -> Fixed {
let mag = core::integer::u128_try_from_felt252(utils::felt_abs(val)).unwrap();
return FixedTrait::new(mag, utils::felt_sign(val));
return Self::new(mag, utils::felt_sign(val));
}

fn from_unscaled_felt(val: felt252) -> Fixed {
return FixedTrait::from_felt(val * ONE);
return Self::from_felt(val * ONE);
}

fn abs(self: Fixed) -> Fixed {
Expand Down Expand Up @@ -551,7 +551,7 @@ impl FixedOne of core::num::traits::One<Fixed> {
}
#[inline(always)]
fn is_one(self: @Fixed) -> bool {
*self == FixedOne::one()
*self == Self::one()
}
#[inline(always)]
fn is_non_one(self: @Fixed) -> bool {
Expand Down
6 changes: 3 additions & 3 deletions src/f64/types/fixed.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ impl FixedImpl of FixedTrait {

fn from_felt(val: felt252) -> Fixed {
let mag = core::integer::u64_try_from_felt252(utils::felt_abs(val)).unwrap();
return FixedTrait::new(mag, utils::felt_sign(val));
return Self::new(mag, utils::felt_sign(val));
}

fn from_unscaled_felt(val: felt252) -> Fixed {
return FixedTrait::from_felt(val * ONE.into());
return Self::from_felt(val * ONE.into());
}

fn abs(self: Fixed) -> Fixed {
Expand Down Expand Up @@ -548,7 +548,7 @@ impl FixedOne of core::num::traits::One<Fixed> {
}
#[inline(always)]
fn is_one(self: @Fixed) -> bool {
*self == FixedOne::one()
*self == Self::one()
}
#[inline(always)]
fn is_non_one(self: @Fixed) -> bool {
Expand Down

0 comments on commit 0c47cf6

Please sign in to comment.