Skip to content

Commit c1c67e0

Browse files
committed
Fix stack overflow
Fixes parcel-bundler#242
1 parent 477ce00 commit c1c67e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/traits.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ pub trait Sign {
183183

184184
/// Returns whether the value is positive.
185185
fn is_sign_positive(&self) -> bool {
186-
self.sign().is_sign_positive()
186+
f32::is_sign_positive(self.sign())
187187
}
188188

189189
/// Returns whether the value is negative.
190190
fn is_sign_negative(&self) -> bool {
191-
self.sign().is_sign_negative()
191+
f32::is_sign_negative(self.sign())
192192
}
193193
}
194194

@@ -199,12 +199,12 @@ pub trait TrySign {
199199

200200
/// Returns whether the value is positive. If not possible, returns false.
201201
fn is_sign_positive(&self) -> bool {
202-
self.try_sign().map_or(false, |s| s.is_sign_positive())
202+
self.try_sign().map_or(false, |s| f32::is_sign_positive(s))
203203
}
204204

205205
/// Returns whether the value is negative. If not possible, returns false.
206206
fn is_sign_negative(&self) -> bool {
207-
self.try_sign().map_or(false, |s| s.is_sign_negative())
207+
self.try_sign().map_or(false, |s| f32::is_sign_negative(s))
208208
}
209209
}
210210

src/values/number.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl Map for CSSNumber {
9191
impl Sign for CSSNumber {
9292
fn sign(&self) -> f32 {
9393
if *self == 0.0 {
94-
return if self.is_sign_positive() { 0.0 } else { -0.0 };
94+
return if f32::is_sign_positive(*self) { 0.0 } else { -0.0 };
9595
}
9696
self.signum()
9797
}

0 commit comments

Comments
 (0)