Fixes matches! formatting using Rust 1.50

pull/82/head
Tpt 4 years ago
parent 0e433e6c2f
commit fce1b03051
  1. 5
      lib/src/model/literal.rs
  2. 10
      lib/src/sparql/eval.rs
  3. 66
      lib/src/store/numeric_encoder.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]

@ -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) => {

@ -256,47 +256,53 @@ impl<I: StrId> Hash for EncodedTerm<I> {
impl<I: StrId> EncodedTerm<I> {
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 {

Loading…
Cancel
Save