chore: run rustfmt
This commit is contained in:
parent
00a1c32fc1
commit
ad4d85ec3d
6 changed files with 25 additions and 19 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
use std::{any::Any, collections::HashSet};
|
use std::any::Any;
|
||||||
|
use std::collections::HashSet;
|
||||||
|
|
||||||
mod bool_ops;
|
mod bool_ops;
|
||||||
mod internal_macros;
|
mod internal_macros;
|
||||||
|
|
@ -10,9 +11,8 @@ pub use bool_ops::*;
|
||||||
pub use num_ops::*;
|
pub use num_ops::*;
|
||||||
pub use traits::*;
|
pub use traits::*;
|
||||||
|
|
||||||
use crate::{ArgusResult, Error};
|
|
||||||
|
|
||||||
use self::iter::AstIter;
|
use self::iter::AstIter;
|
||||||
|
use crate::{ArgusResult, Error};
|
||||||
|
|
||||||
/// All expressions that are numeric
|
/// All expressions that are numeric
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,10 @@ impl<'a> Iterator for AstIter<'a> {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::expr::{Expr, ExprBuilder, ExprRef};
|
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
||||||
|
use crate::expr::{Expr, ExprBuilder, ExprRef};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn simple_iter() {
|
fn simple_iter() {
|
||||||
let mut ctx = ExprBuilder::new();
|
let mut ctx = ExprBuilder::new();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
use super::{internal_macros, BoolExpr, NumExpr};
|
|
||||||
use std::ops::{Add, Div, Mul, Neg};
|
use std::ops::{Add, Div, Mul, Neg};
|
||||||
|
|
||||||
|
use super::{internal_macros, BoolExpr, NumExpr};
|
||||||
|
|
||||||
impl Neg for NumExpr {
|
impl Neg for NumExpr {
|
||||||
type Output = NumExpr;
|
type Output = NumExpr;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
|
|
||||||
use super::{iter::AstIter, ExprRef};
|
use super::iter::AstIter;
|
||||||
|
use super::ExprRef;
|
||||||
|
|
||||||
/// A trait representing expressions
|
/// A trait representing expressions
|
||||||
pub trait Expr {
|
pub trait Expr {
|
||||||
|
|
@ -25,9 +26,10 @@ impl dyn Expr {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use proptest::prelude::*;
|
||||||
|
|
||||||
use super::super::{arbitrary, BoolExpr, NumExpr};
|
use super::super::{arbitrary, BoolExpr, NumExpr};
|
||||||
use super::*;
|
use super::*;
|
||||||
use proptest::prelude::*;
|
|
||||||
|
|
||||||
proptest! {
|
proptest! {
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,11 @@
|
||||||
pub mod iter;
|
pub mod iter;
|
||||||
pub mod traits;
|
pub mod traits;
|
||||||
|
|
||||||
use std::{
|
use std::ops::{RangeFull, RangeInclusive};
|
||||||
ops::{RangeFull, RangeInclusive},
|
use std::time::Duration;
|
||||||
time::Duration,
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::{ArgusResult, Error};
|
|
||||||
|
|
||||||
use self::traits::{BaseSignal, LinearInterpolatable};
|
use self::traits::{BaseSignal, LinearInterpolatable};
|
||||||
|
use crate::{ArgusResult, Error};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
pub enum InterpolationMethod {
|
pub enum InterpolationMethod {
|
||||||
|
|
@ -253,9 +250,11 @@ impl<T> BaseSignal for ConstantSignal<T> {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub mod arbitrary {
|
pub mod arbitrary {
|
||||||
|
|
||||||
use super::*;
|
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use proptest::{prelude::*, sample::SizeRange};
|
use proptest::prelude::*;
|
||||||
|
use proptest::sample::SizeRange;
|
||||||
|
|
||||||
|
use super::*;
|
||||||
|
|
||||||
/// Generate an arbitrary list of samples and two indices within the list
|
/// Generate an arbitrary list of samples and two indices within the list
|
||||||
pub fn samples_and_indices<T>(
|
pub fn samples_and_indices<T>(
|
||||||
|
|
@ -312,11 +311,13 @@ pub mod arbitrary {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
|
||||||
use core::ops::Bound;
|
use core::ops::Bound;
|
||||||
|
|
||||||
use paste::paste;
|
use paste::paste;
|
||||||
use proptest::prelude::*;
|
use proptest::prelude::*;
|
||||||
|
|
||||||
|
use super::*;
|
||||||
|
|
||||||
macro_rules! correctly_create_signals_impl {
|
macro_rules! correctly_create_signals_impl {
|
||||||
($ty:ty) => {
|
($ty:ty) => {
|
||||||
proptest! {
|
proptest! {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
use num_traits::Num;
|
use std::ops::RangeBounds;
|
||||||
use std::{ops::RangeBounds, time::Duration};
|
use std::time::Duration;
|
||||||
|
|
||||||
use crate::ArgusResult;
|
use num_traits::Num;
|
||||||
|
|
||||||
use super::{InterpolationMethod, Sample};
|
use super::{InterpolationMethod, Sample};
|
||||||
|
use crate::ArgusResult;
|
||||||
|
|
||||||
/// A general Signal trait
|
/// A general Signal trait
|
||||||
pub trait BaseSignal {
|
pub trait BaseSignal {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue