Skip to content

Commit 3b92bcd

Browse files
A bit changes
1 parent 94a30d4 commit 3b92bcd

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/lib.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
use intmap::IntMap;
66
use std::{collections::HashMap, fmt};
77

8-
pub mod row;
9-
pub mod collumn;
108
pub mod collection;
9+
pub mod collumn;
10+
pub mod row;
1111

1212
#[derive(Clone, Debug)]
1313
pub struct Channel<'a> {
@@ -32,8 +32,8 @@ pub struct DataCellChangeRecord<T>
3232
where
3333
T: fmt::Display,
3434
{
35-
pub row_index: i64,
36-
pub column_index: i64,
35+
pub row_index: usize,
36+
pub column_index: usize,
3737
pub old_value: T,
3838
pub new_value: T,
3939
}
@@ -42,7 +42,7 @@ impl<T> DataCellChangeRecord<T>
4242
where
4343
T: fmt::Display,
4444
{
45-
fn new(row_index: i64, column_index: i64, old_value: T, new_value: T) -> Self {
45+
fn new(row_index: usize, column_index: usize, old_value: T, new_value: T) -> Self {
4646
Self {
4747
row_index,
4848
column_index,
@@ -95,7 +95,7 @@ impl fmt::Display for DataCollectionChangeRecord {
9595
pub trait TableEntity {}
9696

9797
#[derive(Clone)]
98-
pub struct DataStream<'a, M, D>
98+
pub struct DataStream<'a, M, D>
9999
where
100100
M: fmt::Display,
101101
D: fmt::Display,
@@ -111,27 +111,27 @@ where
111111
// rowsChangeController: StreamController<DataCollectionChangeRecord>,
112112
}
113113

114-
impl<'a, M, D> Default for DataStream<'a, M, D>
114+
impl<'a, M, D> Default for DataStream<'a, M, D>
115115
where
116116
M: fmt::Display,
117117
D: fmt::Display,
118118
{
119119
fn default() -> Self {
120-
Self{
120+
Self {
121121
meta: Vec::new(),
122122
frames: Vec::new(),
123123
}
124124
}
125125
}
126126

127-
impl<'a, M, D> DataStream<'a, M, D>
127+
impl<'a, M, D> DataStream<'a, M, D>
128128
where
129129
M: fmt::Display,
130130
D: fmt::Display,
131131
{
132132
/// Creates a [DataTable] with optional data [data].
133133
///
134-
/// * 'metadata' - contains row names
134+
/// * 'meta' - contains row names
135135
///
136136
/// The first row in [data] contains the column names.
137137
/// The data type of each column is determined by the first non-null value
@@ -140,7 +140,7 @@ where
140140
/// All values in each column are expected to be of the same type,
141141
/// and all rows are expected to have the same length.
142142
// data is optional
143-
pub fn new(metadata: Vec<Channel>, data: Vec<DataFrame<M, D>>) -> Self {
143+
pub fn new(meta: Vec<Channel<'a>>, frames: Vec<DataFrame<M, D>>) -> Self {
144144
// let data_table = DataTable {
145145
// // column_index_by_name: Default::default(),
146146
// // columns: None,
@@ -161,7 +161,7 @@ where
161161
// }
162162

163163
// rows.add_all(data);
164-
unimplemented!()
164+
Self { meta, frames }
165165
}
166166

167167
fn on_cell_changed(row_index: i64, column_index: i64, old_value: String, new_value: String) {
@@ -270,7 +270,6 @@ where
270270
// }
271271
}
272272

273-
274273
#[cfg(test)]
275274
mod tests {
276275
#[test]

0 commit comments

Comments
 (0)