From 20904ab4e2df5617efa7fda50b4735d67bd5d091 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Thu, 5 Dec 2013 23:09:03 -0800 Subject: [PATCH] Style cleanup --- types/mod.rs | 24 ++++++++++++------------ types/range.rs | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/types/mod.rs b/types/mod.rs index 71e4b32c..0fe5dbab 100644 --- a/types/mod.rs +++ b/types/mod.rs @@ -617,15 +617,15 @@ macro_rules! to_range_impl( if self.is_empty() { tag |= RANGE_EMPTY; } else { - match self.lower() { - &None => tag |= RANGE_LOWER_UNBOUNDED, - &Some(RangeBound { type_: Inclusive, .. }) => + match *self.lower() { + None => tag |= RANGE_LOWER_UNBOUNDED, + Some(RangeBound { type_: Inclusive, .. }) => tag |= RANGE_LOWER_INCLUSIVE, _ => {} } - match self.upper() { - &None => tag |= RANGE_UPPER_UNBOUNDED, - &Some(RangeBound { type_: Inclusive, .. }) => + match *self.upper() { + None => tag |= RANGE_UPPER_UNBOUNDED, + Some(RangeBound { type_: Inclusive, .. }) => tag |= RANGE_UPPER_INCLUSIVE, _ => {} } @@ -633,19 +633,19 @@ macro_rules! to_range_impl( buf.write_i8(tag); - match self.lower() { - &Some(ref bound) => { + match *self.lower() { + Some(ref bound) => { buf.write_be_i32(bound.value.raw_size() as i32); bound.value.raw_to_sql(&mut buf); } - &None => {} + None => {} } - match self.upper() { - &Some(ref bound) => { + match *self.upper() { + Some(ref bound) => { buf.write_be_i32(bound.value.raw_size() as i32); bound.value.raw_to_sql(&mut buf); } - &None => {} + None => {} } (Binary, Some(buf.inner())) diff --git a/types/range.rs b/types/range.rs index e88c9f3f..428c78d0 100644 --- a/types/range.rs +++ b/types/range.rs @@ -156,8 +156,8 @@ impl Range { /// If a bound is `None`, the range is unbounded in that direction. pub fn new(lower: Option>, upper: Option>) -> Range { - let lower = lower.map(|bound| { Normalizable::normalize(bound) }); - let upper = upper.map(|bound| { Normalizable::normalize(bound) }); + let lower = lower.map(|bound| Normalizable::normalize(bound)); + let upper = upper.map(|bound| Normalizable::normalize(bound)); match (&lower, &upper) { (&Some(ref lower), &Some(ref upper)) => { @@ -209,8 +209,8 @@ impl Range { match *self { Empty => false, Normal(ref lower, ref upper) => { - lower.as_ref().map_default(true, |b| { b.in_bounds(value) }) && - upper.as_ref().map_default(true, |b| { b.in_bounds(value) }) + lower.as_ref().map_default(true, |b| b.in_bounds(value)) && + upper.as_ref().map_default(true, |b| b.in_bounds(value)) } } }