Skip to content

Commit

Permalink
refine code style according to the CR #2
Browse files Browse the repository at this point in the history
  • Loading branch information
bb7133 committed Jul 24, 2018
1 parent 9f3b384 commit cc78a78
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/coprocessor/dag/expr/builtin_compare.rs
Expand Up @@ -204,10 +204,9 @@ impl ScalarFunc {
}

pub fn interval_int(&self, ctx: &mut EvalContext, row: &[Datum]) -> Result<Option<i64>> {
let target = match self.children[0].eval_int(ctx, row) {
Err(e) => return Err(e),
Ok(None) => return Ok(Some(-1)),
Ok(Some(v)) => v,
let target = match self.children[0].eval_int(ctx, row)? {
None => return Ok(Some(-1)),
Some(v) => v,
};
let tus = mysql::has_unsigned_flag(self.children[0].get_tp().get_flag());

Expand Down Expand Up @@ -236,10 +235,9 @@ impl ScalarFunc {
}

pub fn interval_real(&self, ctx: &mut EvalContext, row: &[Datum]) -> Result<Option<i64>> {
let target = match self.children[0].eval_real(ctx, row) {
Err(e) => return Err(e),
Ok(None) => return Ok(Some(-1)),
Ok(Some(v)) => v,
let target = match self.children[0].eval_real(ctx, row)? {
None => return Ok(Some(-1)),
Some(v) => v,
};

let mut left = 1;
Expand Down

0 comments on commit cc78a78

Please sign in to comment.