From 1f4e9e2a8b9b982060fe6372ece82c6dc91e6506 Mon Sep 17 00:00:00 2001 From: Fabrice Reix Date: Fri, 12 Feb 2021 10:56:32 +0100 Subject: [PATCH] cargo fmt --- packages/hurl/src/runner/predicate.rs | 30 +++++++++++++-------------- packages/hurl/src/runner/template.rs | 5 ++++- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/packages/hurl/src/runner/predicate.rs b/packages/hurl/src/runner/predicate.rs index 715356715..52f02939f 100644 --- a/packages/hurl/src/runner/predicate.rs +++ b/packages/hurl/src/runner/predicate.rs @@ -344,11 +344,17 @@ fn eval_something( PredicateFuncValue::GreaterThanOrEqualInt { value: expected, .. - } => Ok(assert_values_greater_or_equal(value, Value::Integer(expected))), + } => Ok(assert_values_greater_or_equal( + value, + Value::Integer(expected), + )), PredicateFuncValue::GreaterThanOrEqualFloat { value: Float { int, decimal, .. }, .. - } => Ok(assert_values_greater_or_equal(value, Value::Float(int, decimal))), + } => Ok(assert_values_greater_or_equal( + value, + Value::Float(int, decimal), + )), PredicateFuncValue::LessThanInt { value: expected, .. @@ -364,7 +370,10 @@ fn eval_something( PredicateFuncValue::LessThanOrEqualFloat { value: Float { int, decimal, .. }, .. - } => Ok(assert_values_less_or_equal(value, Value::Float(int, decimal))), + } => Ok(assert_values_less_or_equal( + value, + Value::Float(int, decimal), + )), // countEquals PredicateFuncValue::CountEqual { @@ -627,10 +636,7 @@ fn assert_values_equal(actual: Value, expected: Value) -> AssertResult { } } -fn assert_values_greater( - actual_value: Value, - expected_value: Value, -) -> AssertResult { +fn assert_values_greater(actual_value: Value, expected_value: Value) -> AssertResult { let actual = actual_value.clone().display(); let expected = format!("greater than {}", expected_value.clone().display()); match compare_numbers(actual_value, expected_value) { @@ -655,10 +661,7 @@ fn assert_values_greater( } } -fn assert_values_greater_or_equal( - actual_value: Value, - expected_value: Value, -) -> AssertResult { +fn assert_values_greater_or_equal(actual_value: Value, expected_value: Value) -> AssertResult { let actual = actual_value.clone().display(); let expected = format!("greater or equal than {}", expected_value.clone().display()); match compare_numbers(actual_value, expected_value) { @@ -708,10 +711,7 @@ fn assert_values_less(actual_value: Value, expected_value: Value) -> AssertResul } } -fn assert_values_less_or_equal( - actual_value: Value, - expected_value: Value, -) -> AssertResult { +fn assert_values_less_or_equal(actual_value: Value, expected_value: Value) -> AssertResult { let actual = actual_value.clone().display(); let expected = format!("less or equal than {}", expected_value.clone().display()); match compare_numbers(actual_value, expected_value) { diff --git a/packages/hurl/src/runner/template.rs b/packages/hurl/src/runner/template.rs index 3175e9e80..4e1633880 100644 --- a/packages/hurl/src/runner/template.rs +++ b/packages/hurl/src/runner/template.rs @@ -76,7 +76,10 @@ pub fn eval_expression(expr: Expr, variables: &HashMap) -> Result impl Value { pub fn is_renderable(&self) -> bool { - matches!(self, Value::Integer(_) | Value::Bool(_) | Value::Float(_, _) | Value::String(_)) + matches!( + self, + Value::Integer(_) | Value::Bool(_) | Value::Float(_, _) | Value::String(_) + ) } }