Skip to content

Commit 70cd3dc

Browse files
authored
Small refactoring (#310)
1 parent 4f274ab commit 70cd3dc

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/value.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ macro_rules! box_to_opt_ref {
580580
#[cfg(feature = "with-json")]
581581
impl Value {
582582
pub fn is_json(&self) -> bool {
583-
return matches!(self, Self::Json(_));
583+
matches!(self, Self::Json(_))
584584
}
585585

586586
pub fn as_ref_json(&self) -> Option<&Json> {
@@ -594,7 +594,7 @@ impl Value {
594594
#[cfg(feature = "with-chrono")]
595595
impl Value {
596596
pub fn is_chrono_date(&self) -> bool {
597-
return matches!(self, Self::ChronoDate(_));
597+
matches!(self, Self::ChronoDate(_))
598598
}
599599

600600
pub fn as_ref_chrono_date(&self) -> Option<&NaiveDate> {
@@ -608,7 +608,7 @@ impl Value {
608608
#[cfg(feature = "with-time")]
609609
impl Value {
610610
pub fn is_time_date(&self) -> bool {
611-
return matches!(self, Self::TimeDate(_));
611+
matches!(self, Self::TimeDate(_))
612612
}
613613

614614
pub fn as_ref_time_date(&self) -> Option<&time::Date> {
@@ -622,7 +622,7 @@ impl Value {
622622
#[cfg(feature = "with-chrono")]
623623
impl Value {
624624
pub fn is_chrono_time(&self) -> bool {
625-
return matches!(self, Self::ChronoTime(_));
625+
matches!(self, Self::ChronoTime(_))
626626
}
627627

628628
pub fn as_ref_chrono_time(&self) -> Option<&NaiveTime> {
@@ -636,7 +636,7 @@ impl Value {
636636
#[cfg(feature = "with-time")]
637637
impl Value {
638638
pub fn is_time_time(&self) -> bool {
639-
return matches!(self, Self::TimeTime(_));
639+
matches!(self, Self::TimeTime(_))
640640
}
641641

642642
pub fn as_ref_time_time(&self) -> Option<&time::Time> {
@@ -650,7 +650,7 @@ impl Value {
650650
#[cfg(feature = "with-chrono")]
651651
impl Value {
652652
pub fn is_chrono_date_time(&self) -> bool {
653-
return matches!(self, Self::ChronoDateTime(_));
653+
matches!(self, Self::ChronoDateTime(_))
654654
}
655655

656656
pub fn as_ref_chrono_date_time(&self) -> Option<&NaiveDateTime> {
@@ -664,7 +664,7 @@ impl Value {
664664
#[cfg(feature = "with-time")]
665665
impl Value {
666666
pub fn is_time_date_time(&self) -> bool {
667-
return matches!(self, Self::TimeDateTime(_));
667+
matches!(self, Self::TimeDateTime(_))
668668
}
669669

670670
pub fn as_ref_time_date_time(&self) -> Option<&PrimitiveDateTime> {
@@ -678,7 +678,7 @@ impl Value {
678678
#[cfg(feature = "with-chrono")]
679679
impl Value {
680680
pub fn is_chrono_date_time_utc(&self) -> bool {
681-
return matches!(self, Self::ChronoDateTimeUtc(_));
681+
matches!(self, Self::ChronoDateTimeUtc(_))
682682
}
683683

684684
pub fn as_ref_chrono_date_time_utc(&self) -> Option<&DateTime<Utc>> {
@@ -692,7 +692,7 @@ impl Value {
692692
#[cfg(feature = "with-chrono")]
693693
impl Value {
694694
pub fn is_chrono_date_time_local(&self) -> bool {
695-
return matches!(self, Self::ChronoDateTimeLocal(_));
695+
matches!(self, Self::ChronoDateTimeLocal(_))
696696
}
697697

698698
pub fn as_ref_chrono_date_time_local(&self) -> Option<&DateTime<Local>> {
@@ -706,7 +706,7 @@ impl Value {
706706
#[cfg(feature = "with-chrono")]
707707
impl Value {
708708
pub fn is_chrono_date_time_with_time_zone(&self) -> bool {
709-
return matches!(self, Self::ChronoDateTimeWithTimeZone(_));
709+
matches!(self, Self::ChronoDateTimeWithTimeZone(_))
710710
}
711711

712712
pub fn as_ref_chrono_date_time_with_time_zone(&self) -> Option<&DateTime<FixedOffset>> {
@@ -720,7 +720,7 @@ impl Value {
720720
#[cfg(feature = "with-time")]
721721
impl Value {
722722
pub fn is_time_date_time_with_time_zone(&self) -> bool {
723-
return matches!(self, Self::TimeDateTimeWithTimeZone(_));
723+
matches!(self, Self::TimeDateTimeWithTimeZone(_))
724724
}
725725

726726
pub fn as_ref_time_date_time_with_time_zone(&self) -> Option<&OffsetDateTime> {
@@ -764,7 +764,7 @@ impl Value {
764764
#[cfg(feature = "with-rust_decimal")]
765765
impl Value {
766766
pub fn is_decimal(&self) -> bool {
767-
return matches!(self, Self::Decimal(_));
767+
matches!(self, Self::Decimal(_))
768768
}
769769
pub fn as_ref_decimal(&self) -> Option<&Decimal> {
770770
match self {
@@ -781,7 +781,7 @@ impl Value {
781781
#[cfg(feature = "with-bigdecimal")]
782782
impl Value {
783783
pub fn is_big_decimal(&self) -> bool {
784-
return matches!(self, Self::BigDecimal(_));
784+
matches!(self, Self::BigDecimal(_))
785785
}
786786
pub fn as_ref_big_decimal(&self) -> Option<&BigDecimal> {
787787
match self {
@@ -798,7 +798,7 @@ impl Value {
798798
#[cfg(feature = "with-uuid")]
799799
impl Value {
800800
pub fn is_uuid(&self) -> bool {
801-
return matches!(self, Self::Uuid(_));
801+
matches!(self, Self::Uuid(_))
802802
}
803803
pub fn as_ref_uuid(&self) -> Option<&Uuid> {
804804
match self {
@@ -811,7 +811,7 @@ impl Value {
811811
#[cfg(feature = "postgres-array")]
812812
impl Value {
813813
pub fn is_array(&self) -> bool {
814-
return matches!(self, Self::Array(_));
814+
matches!(self, Self::Array(_))
815815
}
816816

817817
pub fn as_ref_array(&self) -> Option<&Vec<Value>> {

0 commit comments

Comments
 (0)