Skip to content

Commit

Permalink
fix: drop unused pub fn using to cargo_workspace_unused (GreptimeTeam…
Browse files Browse the repository at this point in the history
…#5352)

* fix: drop unused pub fn using to cargo_workspace_unused

Signed-off-by: yihong0618 <[email protected]>

* fix: seems is_sum can delete too

Signed-off-by: yihong0618 <[email protected]>

---------

Signed-off-by: yihong0618 <[email protected]>
  • Loading branch information
yihong0618 authored Jan 18, 2025
1 parent 0607b38 commit d072801
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 60 deletions.
5 changes: 0 additions & 5 deletions src/common/time/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions src/flow/src/expr/relation/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 0 additions & 32 deletions src/flow/src/repr/relation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -550,32 +544,6 @@ impl RelationDesc {
pub fn get_name(&self, i: usize) -> &Option<ColumnName> {
&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<ColumnName> {
&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`].
Expand Down
18 changes: 0 additions & 18 deletions src/servers/src/repeated_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,36 +144,18 @@ impl<T> RepeatedField<T> {
&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]) {
Expand Down

0 comments on commit d072801

Please sign in to comment.