Use explicit unreachable in rust pattern matching
This commit is contained in:
parent
bc81165be4
commit
2b45ef22a5
@ -461,7 +461,10 @@ fn parse_prop(s: &str) -> ParseResult<SearchNode> {
|
||||
));
|
||||
};
|
||||
|
||||
Ok(SearchNode::Property { operator, kind })
|
||||
Ok(SearchNode::Property {
|
||||
operator: operator.to_string(),
|
||||
kind,
|
||||
})
|
||||
}
|
||||
|
||||
/// eg added:1
|
||||
|
@ -226,8 +226,19 @@ impl SqlWriter<'_> {
|
||||
">=" => write!(self.sql, " >= {}", day_before_cutoff_ms),
|
||||
"<" => write!(self.sql, " < {}", day_before_cutoff_ms),
|
||||
"<=" => write!(self.sql, " < {}", target_cutoff_ms),
|
||||
"=" => write!(self.sql, " between {} and {}", day_before_cutoff_ms, target_cutoff_ms - 1),
|
||||
_ /* "!=" */ => write!(self.sql, " not between {} and {}", day_before_cutoff_ms, target_cutoff_ms - 1),
|
||||
"=" => write!(
|
||||
self.sql,
|
||||
" between {} and {}",
|
||||
day_before_cutoff_ms,
|
||||
target_cutoff_ms - 1
|
||||
),
|
||||
"!=" => write!(
|
||||
self.sql,
|
||||
" not between {} and {}",
|
||||
day_before_cutoff_ms,
|
||||
target_cutoff_ms - 1
|
||||
),
|
||||
_ => unreachable!("unexpected op"),
|
||||
}
|
||||
.unwrap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user