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. 6
      lib/src/sparql/eval.rs
  3. 20
      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). /// or has the datatype [xsd:string](http://www.w3.org/2001/XMLSchema#string).
#[inline] #[inline]
pub fn is_plain(self) -> bool { pub fn is_plain(self) -> bool {
matches!(self.0, LiteralRefContent::String(_) | LiteralRefContent::LanguageTaggedString { .. }) matches!(
self.0,
LiteralRefContent::String(_) | LiteralRefContent::LanguageTaggedString { .. }
)
} }
#[inline] #[inline]

@ -1411,11 +1411,13 @@ where
Some(self.eval_expression(e, tuple)?.is_literal().into()) Some(self.eval_expression(e, tuple)?.is_literal().into())
} }
PlanExpression::IsNumeric(e) => Some( PlanExpression::IsNumeric(e) => Some(
matches!(self.eval_expression(e, tuple)?, matches!(
self.eval_expression(e, tuple)?,
EncodedTerm::FloatLiteral(_) EncodedTerm::FloatLiteral(_)
| EncodedTerm::DoubleLiteral(_) | EncodedTerm::DoubleLiteral(_)
| EncodedTerm::IntegerLiteral(_) | EncodedTerm::IntegerLiteral(_)
| EncodedTerm::DecimalLiteral(_)) | EncodedTerm::DecimalLiteral(_)
)
.into(), .into(),
), ),
PlanExpression::Regex(text, pattern, flags) => { PlanExpression::Regex(text, pattern, flags) => {

@ -256,19 +256,21 @@ impl<I: StrId> Hash for EncodedTerm<I> {
impl<I: StrId> EncodedTerm<I> { impl<I: StrId> EncodedTerm<I> {
pub fn is_named_node(&self) -> bool { pub fn is_named_node(&self) -> bool {
matches!(self, matches!(self, Self::NamedNode { .. })
Self::NamedNode { .. })
} }
pub fn is_blank_node(&self) -> bool { pub fn is_blank_node(&self) -> bool {
matches!(self, matches!(
self,
Self::NumericalBlankNode { .. } Self::NumericalBlankNode { .. }
| Self::SmallBlankNode { .. } | Self::SmallBlankNode { .. }
| Self::BigBlankNode { .. }) | Self::BigBlankNode { .. }
)
} }
pub fn is_literal(&self) -> bool { pub fn is_literal(&self) -> bool {
matches!(self, matches!(
self,
Self::SmallStringLiteral { .. } Self::SmallStringLiteral { .. }
| Self::BigStringLiteral { .. } | Self::BigStringLiteral { .. }
| Self::SmallSmallLangStringLiteral { .. } | Self::SmallSmallLangStringLiteral { .. }
@ -292,11 +294,15 @@ impl<I: StrId> EncodedTerm<I> {
| Self::GMonthLiteral(_) | Self::GMonthLiteral(_)
| Self::DurationLiteral(_) | Self::DurationLiteral(_)
| Self::YearMonthDurationLiteral(_) | Self::YearMonthDurationLiteral(_)
| Self::DayTimeDurationLiteral(_)) | Self::DayTimeDurationLiteral(_)
)
} }
pub fn is_unknown_typed_literal(&self) -> bool { 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 { pub fn is_default_graph(&self) -> bool {

Loading…
Cancel
Save