From 195f7a15958995ddb0e3fef4df25c4a3fcd5c1e9 Mon Sep 17 00:00:00 2001 From: Tpt Date: Tue, 13 Jun 2023 20:53:48 +0200 Subject: [PATCH] calendar subtraction: it should return xsd:dayTimeDuration following XPath --- lib/src/sparql/eval.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/src/sparql/eval.rs b/lib/src/sparql/eval.rs index f4620f56..39921069 100644 --- a/lib/src/sparql/eval.rs +++ b/lib/src/sparql/eval.rs @@ -1102,15 +1102,9 @@ impl SimpleEvaluator { NumericBinaryOperands::Double(v1, v2) => (v1 - v2).into(), NumericBinaryOperands::Integer(v1, v2) => v1.checked_sub(v2)?.into(), NumericBinaryOperands::Decimal(v1, v2) => v1.checked_sub(v2)?.into(), - NumericBinaryOperands::DateTime(v1, v2) => { - Duration::from(v1.checked_sub(v2)?).into() - } - NumericBinaryOperands::Date(v1, v2) => { - Duration::from(v1.checked_sub(v2)?).into() - } - NumericBinaryOperands::Time(v1, v2) => { - Duration::from(v1.checked_sub(v2)?).into() - } + NumericBinaryOperands::DateTime(v1, v2) => v1.checked_sub(v2)?.into(), + NumericBinaryOperands::Date(v1, v2) => v1.checked_sub(v2)?.into(), + NumericBinaryOperands::Time(v1, v2) => v1.checked_sub(v2)?.into(), NumericBinaryOperands::Duration(v1, v2) => v1.checked_sub(v2)?.into(), NumericBinaryOperands::YearMonthDuration(v1, v2) => { v1.checked_sub(v2)?.into()