Allow math avg to work on durations (#2529)

* Allow `math avg` to work on durations

* formatting

* fix linting issue and implemented `math sum` for duration

* fix linting issue

* applied requested changes

* applied requested change for avg.rs

* formatting
This commit is contained in:
gorogoroumaru
2020-09-13 08:56:05 +09:00
committed by GitHub
parent 7528094e12
commit 45f32c9541
4 changed files with 50 additions and 0 deletions

View File

@ -83,6 +83,10 @@ impl UntaggedValue {
matches!(self, UntaggedValue::Primitive(Primitive::Filesize(_)))
}
pub fn is_duration(&self) -> bool {
matches!(self, UntaggedValue::Primitive(Primitive::Duration(_)))
}
/// Returns true if this value represents a table
pub fn is_table(&self) -> bool {
matches!(self, UntaggedValue::Table(_))