Skip to content

Commit

Permalink
Format code with nightly.
Browse files Browse the repository at this point in the history
  • Loading branch information
ISibboI committed Dec 27, 2024
1 parent 758db32 commit 7ec053d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
33 changes: 25 additions & 8 deletions src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,14 @@ impl<NumericTypes: EvalexprNumericTypes> Context for EmptyContext<NumericTypes>
}

impl<NumericTypes: EvalexprNumericTypes> IterateVariablesContext for EmptyContext<NumericTypes> {
type VariableIterator<'a> = iter::Empty<(String, Value<Self::NumericTypes>)> where Self: 'a;
type VariableNameIterator<'a> = iter::Empty<String> where Self: 'a;
type VariableIterator<'a>
= iter::Empty<(String, Value<Self::NumericTypes>)>
where
Self: 'a;
type VariableNameIterator<'a>
= iter::Empty<String>
where
Self: 'a;

fn iter_variables(&self) -> Self::VariableIterator<'_> {
iter::empty()
Expand Down Expand Up @@ -201,8 +207,14 @@ impl<NumericTypes: EvalexprNumericTypes> Context
impl<NumericTypes: EvalexprNumericTypes> IterateVariablesContext
for EmptyContextWithBuiltinFunctions<NumericTypes>
{
type VariableIterator<'a> = iter::Empty<(String, Value<Self::NumericTypes>)> where Self: 'a;
type VariableNameIterator<'a> = iter::Empty<String> where Self:'a;
type VariableIterator<'a>
= iter::Empty<(String, Value<Self::NumericTypes>)>
where
Self: 'a;
type VariableNameIterator<'a>
= iter::Empty<String>
where
Self: 'a;

fn iter_variables(&self) -> Self::VariableIterator<'_> {
iter::empty()
Expand Down Expand Up @@ -356,12 +368,17 @@ impl<NumericTypes: EvalexprNumericTypes> ContextWithMutableFunctions
}

impl<NumericTypes: EvalexprNumericTypes> IterateVariablesContext for HashMapContext<NumericTypes> {
type VariableIterator<'a> = std::iter::Map<
type VariableIterator<'a>
= std::iter::Map<
std::collections::hash_map::Iter<'a, String, Value<NumericTypes>>,
fn((&String, &Value<NumericTypes>)) -> (String, Value<NumericTypes>),
> where Self: 'a;
type VariableNameIterator<'a> =
std::iter::Cloned<std::collections::hash_map::Keys<'a, String, Value<NumericTypes>>> where Self: 'a;
>
where
Self: 'a;
type VariableNameIterator<'a>
= std::iter::Cloned<std::collections::hash_map::Keys<'a, String, Value<NumericTypes>>>
where
Self: 'a;

fn iter_variables(&self) -> Self::VariableIterator<'_> {
self.variables
Expand Down
9 changes: 7 additions & 2 deletions src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
use std::ops::RangeInclusive;

use crate::value::numeric_types::{DefaultNumericTypes, EvalexprNumericTypes};
use crate::{token::PartialToken, value::value_type::ValueType};
use crate::{
token::PartialToken,
value::{
numeric_types::{DefaultNumericTypes, EvalexprNumericTypes},
value_type::ValueType,
},
};

use crate::{operator::Operator, value::Value};

Expand Down
11 changes: 8 additions & 3 deletions src/operator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
use crate::function::builtin::builtin_function;

use crate::value::numeric_types::{
DefaultNumericTypes, EvalexprFloat, EvalexprInt, EvalexprNumericTypes,
use crate::{
context::Context,
error::*,
value::{
numeric_types::{DefaultNumericTypes, EvalexprFloat, EvalexprInt, EvalexprNumericTypes},
Value,
},
ContextWithMutableVariables,
};
use crate::{context::Context, error::*, value::Value, ContextWithMutableVariables};

mod display;

Expand Down

0 comments on commit 7ec053d

Please sign in to comment.