Skip to content

Commit

Permalink
auto impl Display for FrameBounds
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chien <[email protected]>
  • Loading branch information
stdrc committed Jan 10, 2024
1 parent d550432 commit eabd73d
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions src/expr/core/src/window_function/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ impl Frame {
}
}

#[derive(Display, Debug, Clone, Eq, PartialEq, Hash)]
#[display("{0}")]
pub enum FrameBounds {
Rows(RowsFrameBounds),
// Groups(GroupsFrameBounds),
// Range(RangeFrameBounds),
}

impl FrameBounds {
pub fn validate(&self) -> Result<()> {
match self {
Expand All @@ -135,21 +143,6 @@ impl FrameBounds {
}
}

impl Display for FrameBounds {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Rows(bounds) => bounds.fmt(f),
}
}
}

#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub enum FrameBounds {
Rows(RowsFrameBounds),
// Groups(GroupsFrameBounds),
// Range(RangeFrameBounds),
}

#[derive(Display, Debug, Clone, Eq, PartialEq, Hash)]
#[display("ROWS BETWEEN {start} AND {end}")]
pub struct RowsFrameBounds {
Expand Down

0 comments on commit eabd73d

Please sign in to comment.