Skip to content

Commit 097b3bd

Browse files
author
梶塚太智
committed
Update main.rs
1 parent 60c1505 commit 097b3bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl Type {
133133
}
134134
}
135135
Type::List(l) => l.len() as f64,
136-
Type::Error(_) => 0f64,
136+
Type::Error(e) => e.parse().unwrap_or(0f64),
137137
}
138138
}
139139

@@ -144,7 +144,7 @@ impl Type {
144144
Type::Number(i) => *i != 0.0,
145145
Type::Bool(b) => *b,
146146
Type::List(l) => !l.is_empty(),
147-
Type::Error(_) => false,
147+
Type::Error(e) => e.parse().unwrap_or(false),
148148
}
149149
}
150150

0 commit comments

Comments
 (0)