forked from StudioInfinity/dyna3
Refactor: rename loaders and adopt 'Self' type convention (#111)
Resolves #109. Resolves #110. Co-authored-by: Aaron Fenyes <aaron.fenyes@fareycircles.ooo> Reviewed-on: StudioInfinity/dyna3#111 Co-authored-by: Vectornaut <vectornaut@nobody@nowhere.net> Co-committed-by: Vectornaut <vectornaut@nobody@nowhere.net>
This commit is contained in:
parent
ef1a579ac0
commit
a4565281d5
7 changed files with 64 additions and 64 deletions
|
@ -17,8 +17,8 @@ pub struct SpecifiedValue {
|
|||
}
|
||||
|
||||
impl SpecifiedValue {
|
||||
pub fn from_empty_spec() -> SpecifiedValue {
|
||||
SpecifiedValue { spec: String::new(), value: None }
|
||||
pub fn from_empty_spec() -> Self {
|
||||
Self { spec: String::new(), value: None }
|
||||
}
|
||||
|
||||
pub fn is_present(&self) -> bool {
|
||||
|
@ -34,10 +34,10 @@ impl TryFrom<String> for SpecifiedValue {
|
|||
|
||||
fn try_from(spec: String) -> Result<Self, Self::Error> {
|
||||
if spec.is_empty() {
|
||||
Ok(SpecifiedValue::from_empty_spec())
|
||||
Ok(Self::from_empty_spec())
|
||||
} else {
|
||||
spec.parse::<f64>().map(
|
||||
|value| SpecifiedValue { spec, value: Some(value) }
|
||||
|value| Self { spec, value: Some(value) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue