Skip to content

Commit a4360d9

Browse files
committed
Extend the list of string representation of true & false state
1 parent faa44ce commit a4360d9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

crates/gitql-ast/src/types/boolean.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@ impl DataType for BoolType {
109109

110110
fn has_implicit_cast_from(&self, expr: &Box<dyn Expr>) -> bool {
111111
if let Some(string_expr) = expr.as_any().downcast_ref::<StringExpr>() {
112-
const BOOLEANS_VALUES_LITERAL: [&str; 10] =
113-
["t", "true", "y", "yes", "1", "f", "false", "n", "no", "0"];
112+
const BOOLEANS_VALUES_LITERAL: [&str; 12] = [
113+
// String representations for the “true” state
114+
"t", "true", "y", "yes", "on", "1",
115+
// String representations for the false state
116+
"f", "false", "n", "no", "off", "0",
117+
];
114118
return BOOLEANS_VALUES_LITERAL.contains(&string_expr.value.as_str());
115119
}
116120
false

0 commit comments

Comments
 (0)