aboutsummaryrefslogtreecommitdiff
path: root/src/label_format.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/label_format.rs')
-rw-r--r--src/label_format.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/label_format.rs b/src/label_format.rs
index c127e81..254cbd6 100644
--- a/src/label_format.rs
+++ b/src/label_format.rs
@@ -4,18 +4,18 @@ use crate::flood;
use crate::color;
pub trait LabelU16 {
- fn zero(&self) -> Self;
+ fn is_zero(&self) -> bool;
}
impl LabelU16 for u16 {
- fn zero(&self) -> Self {
- 0u16
+ fn is_zero(&self) -> bool {
+ *self == 0u16
}
}
impl LabelU16 for u32 {
- fn zero(&self) -> Self {
- 0u32
+ fn is_zero(&self) -> bool {
+ *self == 0u32
}
}
@@ -41,7 +41,7 @@ impl<T: LabelU16 + PartialEq + Copy> LabelFormat<T> {
for y in 0..self.height {
for x in 0..self.width {
let index = x + y*self.width;
- if self.buffer[index] == self.buffer[index].zero() {
+ if self.buffer[index].is_zero() {
continue;
}
if output_buffer[index] == 0 {