Skip to content

Commit

Permalink
refactor(rust): Remove dead code (#17378)
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion authored Jul 3, 2024
1 parent 60fa8db commit 64e1ca9
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions crates/polars-core/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,6 @@ pub trait IndexOfSchema: Debug {
/// Get a vector of all column names.
fn get_names(&self) -> Vec<&str>;

/// Get a vector of (name, dtype) pairs
fn get_names_and_dtypes(&'_ self) -> Vec<(&'_ str, DataType)>;

fn try_index_of(&self, name: &str) -> PolarsResult<usize> {
self.index_of(name).ok_or_else(|| {
polars_err!(
Expand All @@ -467,13 +464,6 @@ impl IndexOfSchema for Schema {
fn get_names(&self) -> Vec<&str> {
self.iter_names().map(|name| name.as_str()).collect()
}

fn get_names_and_dtypes(&'_ self) -> Vec<(&'_ str, DataType)> {
self.inner
.iter()
.map(|(name, dtype)| (name.as_str(), dtype.clone()))
.collect()
}
}

impl IndexOfSchema for ArrowSchema {
Expand All @@ -484,13 +474,6 @@ impl IndexOfSchema for ArrowSchema {
fn get_names(&self) -> Vec<&str> {
self.fields.iter().map(|f| f.name.as_str()).collect()
}

fn get_names_and_dtypes(&'_ self) -> Vec<(&'_ str, DataType)> {
self.fields
.iter()
.map(|x| (x.name.as_str(), DataType::from_arrow(&x.data_type, true)))
.collect()
}
}

pub trait SchemaNamesAndDtypes {
Expand Down

0 comments on commit 64e1ca9

Please sign in to comment.