diff --git a/lib/src/model/literal.rs b/lib/src/model/literal.rs index fb70c9d6..da929c24 100644 --- a/lib/src/model/literal.rs +++ b/lib/src/model/literal.rs @@ -508,7 +508,10 @@ impl<'a> LiteralRef<'a> { /// or has the datatype [xsd:string](http://www.w3.org/2001/XMLSchema#string). #[inline] pub fn is_plain(self) -> bool { - matches!(self.0, LiteralRefContent::String(_) | LiteralRefContent::LanguageTaggedString { .. }) + matches!( + self.0, + LiteralRefContent::String(_) | LiteralRefContent::LanguageTaggedString { .. } + ) } #[inline] diff --git a/lib/src/sparql/eval.rs b/lib/src/sparql/eval.rs index e5772ec8..f2aee138 100644 --- a/lib/src/sparql/eval.rs +++ b/lib/src/sparql/eval.rs @@ -1411,11 +1411,13 @@ where Some(self.eval_expression(e, tuple)?.is_literal().into()) } PlanExpression::IsNumeric(e) => Some( - matches!(self.eval_expression(e, tuple)?, + matches!( + self.eval_expression(e, tuple)?, EncodedTerm::FloatLiteral(_) - | EncodedTerm::DoubleLiteral(_) - | EncodedTerm::IntegerLiteral(_) - | EncodedTerm::DecimalLiteral(_)) + | EncodedTerm::DoubleLiteral(_) + | EncodedTerm::IntegerLiteral(_) + | EncodedTerm::DecimalLiteral(_) + ) .into(), ), PlanExpression::Regex(text, pattern, flags) => { diff --git a/lib/src/store/numeric_encoder.rs b/lib/src/store/numeric_encoder.rs index 8487c8c7..787252d8 100644 --- a/lib/src/store/numeric_encoder.rs +++ b/lib/src/store/numeric_encoder.rs @@ -256,47 +256,53 @@ impl Hash for EncodedTerm { impl EncodedTerm { pub fn is_named_node(&self) -> bool { - matches!(self, - Self::NamedNode { .. }) + matches!(self, Self::NamedNode { .. }) } pub fn is_blank_node(&self) -> bool { - matches!(self, + matches!( + self, Self::NumericalBlankNode { .. } - | Self::SmallBlankNode { .. } - | Self::BigBlankNode { .. }) + | Self::SmallBlankNode { .. } + | Self::BigBlankNode { .. } + ) } pub fn is_literal(&self) -> bool { - matches!(self, + matches!( + self, Self::SmallStringLiteral { .. } - | Self::BigStringLiteral { .. } - | Self::SmallSmallLangStringLiteral { .. } - | Self::SmallBigLangStringLiteral { .. } - | Self::BigSmallLangStringLiteral { .. } - | Self::BigBigLangStringLiteral { .. } - | Self::SmallTypedLiteral { .. } - | Self::BigTypedLiteral { .. } - | Self::BooleanLiteral(_) - | Self::FloatLiteral(_) - | Self::DoubleLiteral(_) - | Self::IntegerLiteral(_) - | Self::DecimalLiteral(_) - | Self::DateTimeLiteral(_) - | Self::TimeLiteral(_) - | Self::DateLiteral(_) - | Self::GYearMonthLiteral(_) - | Self::GYearLiteral(_) - | Self::GMonthDayLiteral(_) - | Self::GDayLiteral(_) - | Self::GMonthLiteral(_) - | Self::DurationLiteral(_) - | Self::YearMonthDurationLiteral(_) - | Self::DayTimeDurationLiteral(_)) + | Self::BigStringLiteral { .. } + | Self::SmallSmallLangStringLiteral { .. } + | Self::SmallBigLangStringLiteral { .. } + | Self::BigSmallLangStringLiteral { .. } + | Self::BigBigLangStringLiteral { .. } + | Self::SmallTypedLiteral { .. } + | Self::BigTypedLiteral { .. } + | Self::BooleanLiteral(_) + | Self::FloatLiteral(_) + | Self::DoubleLiteral(_) + | Self::IntegerLiteral(_) + | Self::DecimalLiteral(_) + | Self::DateTimeLiteral(_) + | Self::TimeLiteral(_) + | Self::DateLiteral(_) + | Self::GYearMonthLiteral(_) + | Self::GYearLiteral(_) + | Self::GMonthDayLiteral(_) + | Self::GDayLiteral(_) + | Self::GMonthLiteral(_) + | Self::DurationLiteral(_) + | Self::YearMonthDurationLiteral(_) + | Self::DayTimeDurationLiteral(_) + ) } pub fn is_unknown_typed_literal(&self) -> bool { - matches!(self, Self::SmallTypedLiteral { .. } | Self::BigTypedLiteral { .. }) + matches!( + self, + Self::SmallTypedLiteral { .. } | Self::BigTypedLiteral { .. } + ) } pub fn is_default_graph(&self) -> bool {