Removing as_option_end and as_option_start and replacing them with none_if

This commit is contained in:
Pauan 2018-06-08 06:05:15 -10:00
parent 291273bcc0
commit b6d9a547f7
1 changed files with 2 additions and 11 deletions

View File

@ -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 {