Skip to content

Commit

Permalink
auto impl Display for FrameExclusion
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 88c27c1 commit 14d0113
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/expr/core/src/window_function/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ impl FrameBound<usize> {
}
}

#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Default, EnumAsInner)]
#[derive(Display, Debug, Copy, Clone, Eq, PartialEq, Hash, Default, EnumAsInner)]
#[display("EXCLUDE {}", style = "TITLE CASE")]
pub enum FrameExclusion {
CurrentRow,
// Group,
Expand All @@ -254,16 +255,6 @@ pub enum FrameExclusion {
NoOthers,
}

impl Display for FrameExclusion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
FrameExclusion::CurrentRow => write!(f, "EXCLUDE CURRENT ROW")?,
FrameExclusion::NoOthers => write!(f, "EXCLUDE NO OTHERS")?,
}
Ok(())
}
}

impl FrameExclusion {
pub fn from_protobuf(exclusion: PbExclusion) -> Result<Self> {
let excl = match exclusion {
Expand Down

0 comments on commit 14d0113

Please sign in to comment.