Some style changes, removed useless matches and formats

This commit is contained in:
Daniel García
2018-06-11 15:44:37 +02:00
parent 57850a3379
commit 483066b9a0
10 changed files with 70 additions and 113 deletions

View File

@@ -33,14 +33,14 @@ enum NumberOrString {
}
impl NumberOrString {
fn to_string(self) -> String {
fn into_string(self) -> String {
match self {
NumberOrString::Number(n) => n.to_string(),
NumberOrString::String(s) => s
}
}
fn to_i32(self) -> Option<i32> {
fn into_i32(self) -> Option<i32> {
match self {
NumberOrString::Number(n) => Some(n),
NumberOrString::String(s) => s.parse().ok()