Skip to content

Commit

Permalink
Merge pull request #4048 from wangzhen11aaa/f_improve_readability
Browse files Browse the repository at this point in the history
F improve readability
  • Loading branch information
sundy-li authored Feb 3, 2022
2 parents dcf06e2 + 9b214f9 commit 8686115
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/datavalues/src/series/series_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ use common_exception::Result;
use crate::prelude::*;

#[derive(Debug, Clone)]

/// Series is a wrapper type to store pointer to real data.
/// This kind definition of `Series` style will make `Arc<dyn SeriesTrait>` as anonymous field.
pub struct Series(pub Arc<dyn SeriesTrait>);

impl<'a> AsRef<(dyn SeriesTrait + 'a)> for Series {
Expand All @@ -41,6 +44,7 @@ impl Deref for Series {
}
}

/// Various trait implementation for Type is cocked by macro in the wrap module.
pub trait IntoSeries {
fn into_series(self) -> Series;
}
Expand Down Expand Up @@ -308,6 +312,7 @@ impl Series {
}
}

/// Any Array can be converted to a Series Type.
impl IntoSeries for ArrayRef {
fn into_series(self) -> Series {
let data_type = DataType::try_from(self.data_type()).unwrap();
Expand Down

0 comments on commit 8686115

Please sign in to comment.