Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
  • Loading branch information
zhongzc committed Apr 20, 2020
1 parent ed2ede0 commit cfb8313
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/tidb_query_datatype/src/codec/data_type/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl AsMySQLBool for Int {
impl AsMySQLBool for Real {
#[inline]
fn as_mysql_bool(&self, _context: &mut EvalContext) -> Result<bool> {
Ok(self.into_inner() != 0.0)
Ok(self.into_inner() != 0f64)
}
}

Expand Down Expand Up @@ -183,6 +183,7 @@ mod tests {
assert!(val.is_err());
}

#[test]
fn test_real_as_bool() {
let tests: Vec<(f64, Option<bool>)> = vec![
(0.0, Some(false)),
Expand Down

0 comments on commit cfb8313

Please sign in to comment.