From d072801ad6606eb7ff161faae8c7d8057e691b09 Mon Sep 17 00:00:00 2001 From: yihong Date: Sat, 18 Jan 2025 23:59:21 +0800 Subject: [PATCH] fix: drop unused pub fn using to cargo_workspace_unused (#5352) * fix: drop unused pub fn using to cargo_workspace_unused Signed-off-by: yihong0618 * fix: seems is_sum can delete too Signed-off-by: yihong0618 --------- Signed-off-by: yihong0618 --- src/common/time/src/time.rs | 5 ----- src/flow/src/expr/relation/func.rs | 5 ----- src/flow/src/repr/relation.rs | 32 ------------------------------ src/servers/src/repeated_field.rs | 18 ----------------- 4 files changed, 60 deletions(-) diff --git a/src/common/time/src/time.rs b/src/common/time/src/time.rs index f8ffbf3608..16a755ba25 100644 --- a/src/common/time/src/time.rs +++ b/src/common/time/src/time.rs @@ -108,11 +108,6 @@ impl Time { self.as_formatted_string("%H:%M:%S%.f%z", None) } - /// Format Time for system timeszone. - pub fn to_system_tz_string(&self) -> String { - self.as_formatted_string("%H:%M:%S%.f", None) - } - /// Format Time for given timezone. /// When timezone is None, using system timezone by default. pub fn to_timezone_aware_string(&self, tz: Option<&Timezone>) -> String { diff --git a/src/flow/src/expr/relation/func.rs b/src/flow/src/expr/relation/func.rs index fd72b58bb1..29a0169229 100644 --- a/src/flow/src/expr/relation/func.rs +++ b/src/flow/src/expr/relation/func.rs @@ -103,11 +103,6 @@ impl AggregateFunc { self.signature().generic_fn == GenericFn::Min } - /// if this function is a `sum` - pub fn is_sum(&self) -> bool { - self.signature().generic_fn == GenericFn::Sum - } - /// Eval value, diff with accumulator /// /// Expect self to be accumulable aggregate function, i.e. sum/count diff --git a/src/flow/src/repr/relation.rs b/src/flow/src/repr/relation.rs index 168b5df7d0..29cf021520 100644 --- a/src/flow/src/repr/relation.rs +++ b/src/flow/src/repr/relation.rs @@ -489,12 +489,6 @@ impl RelationDesc { self } - /// Drops all existing keys. - pub fn without_keys(mut self) -> Self { - self.typ.keys.clear(); - self - } - /// Builds a new relation description with the column names replaced with /// new names. /// @@ -550,32 +544,6 @@ impl RelationDesc { pub fn get_name(&self, i: usize) -> &Option { &self.names[i] } - - /// Mutably gets the name of the `i`th column. - /// - /// # Panics - /// - /// Panics if `i` is not a valid column index. - pub fn get_name_mut(&mut self, i: usize) -> &mut Option { - &mut self.names[i] - } - - /// Gets the name of the `i`th column if that column name is unambiguous. - /// - /// If at least one other column has the same name as the `i`th column, - /// returns `None`. If the `i`th column has no name, returns `None`. - /// - /// # Panics - /// - /// Panics if `i` is not a valid column index. - pub fn get_unambiguous_name(&self, i: usize) -> Option<&ColumnName> { - let name = &self.names[i]; - if self.iter_names().filter(|n| *n == name).count() == 1 { - name.as_ref() - } else { - None - } - } } /// The name of a column in a [`RelationDesc`]. diff --git a/src/servers/src/repeated_field.rs b/src/servers/src/repeated_field.rs index 1b8f80bea2..6bc20b07c2 100644 --- a/src/servers/src/repeated_field.rs +++ b/src/servers/src/repeated_field.rs @@ -144,36 +144,18 @@ impl RepeatedField { &self.as_ref()[start..end] } - /// Get mutable subslice of this container. - #[inline] - pub fn slice_mut(&mut self, start: usize, end: usize) -> &mut [T] { - &mut self.as_mut_slice()[start..end] - } - /// Get slice from given index. #[inline] pub fn slice_from(&self, start: usize) -> &[T] { &self.as_ref()[start..] } - /// Get mutable slice from given index. - #[inline] - pub fn slice_from_mut(&mut self, start: usize) -> &mut [T] { - &mut self.as_mut_slice()[start..] - } - /// Get slice to given index. #[inline] pub fn slice_to(&self, end: usize) -> &[T] { &self.as_ref()[..end] } - /// Get mutable slice to given index. - #[inline] - pub fn slice_to_mut(&mut self, end: usize) -> &mut [T] { - &mut self.as_mut_slice()[..end] - } - /// View this container as two slices split at given index. #[inline] pub fn split_at(&self, mid: usize) -> (&[T], &[T]) {