Removing as_option_end and as_option_start and replacing them with none_if
This commit is contained in:
parent
291273bcc0
commit
b6d9a547f7
|
@ -461,17 +461,8 @@ impl Percentage {
|
|||
self.0
|
||||
}
|
||||
|
||||
pub fn as_option_end(self) -> Option<Self> {
|
||||
if self.0 == 1.0 {
|
||||
None
|
||||
|
||||
} else {
|
||||
Some(self)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_option_start(self) -> Option<Self> {
|
||||
if self.0 == 0.0 {
|
||||
pub fn none_if(self, percentage: f64) -> Option<Self> {
|
||||
if self.0 == percentage {
|
||||
None
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue