Skip to content

Commit 2e4bfd8

Browse files
committed
chore: update timestamp type option
1 parent 6cdf924 commit 2e4bfd8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

collab-database/src/template/timestamp_parse.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ pub struct TimestampCellData {
1010
}
1111

1212
impl TimestampCellData {
13-
pub fn new(timestamp: Option<i64>) -> Self {
14-
Self { timestamp }
13+
pub fn new<T: Into<Option<i64>>>(timestamp: T) -> Self {
14+
Self {
15+
timestamp: timestamp.into(),
16+
}
1517
}
1618

17-
pub fn to_cell(&self, field_type: FieldType) -> Cell {
18-
let data: TimestampCellDataWrapper = (field_type, self.clone()).into();
19+
pub fn to_cell<T: Into<FieldType>>(&self, field_type: T) -> Cell {
20+
let data: TimestampCellDataWrapper = (field_type.into(), self.clone()).into();
1921
data.into()
2022
}
2123
}

0 commit comments

Comments
 (0)