diff --git a/src/expr/core/src/window_function/call.rs b/src/expr/core/src/window_function/call.rs index a7804be77725c..43545cc2a107a 100644 --- a/src/expr/core/src/window_function/call.rs +++ b/src/expr/core/src/window_function/call.rs @@ -245,7 +245,8 @@ impl FrameBound { } } -#[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, @@ -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 { let excl = match exclusion {