@@ -49,9 +49,8 @@ pub fn materialize_events_append_only<'a>(
49
49
50
50
let mut upsert_rows: Vec < & PgTableRow > = Vec :: new ( ) ;
51
51
for ( _, reg) in crdt_by_key. into_iter ( ) {
52
- match reg. val {
53
- RowOp :: Upsert ( row) => upsert_rows. push ( row) ,
54
- _ => { }
52
+ if let RowOp :: Upsert ( row) = reg. val {
53
+ upsert_rows. push ( row)
55
54
}
56
55
}
57
56
@@ -125,8 +124,8 @@ pub fn materialize_events<'a>(
125
124
mod tests {
126
125
use super :: * ;
127
126
use etl:: types:: {
128
- Cell as PgCell , ColumnSchema as PgColumnSchema , DeleteEvent , InsertEvent , PgLsn , TableId ,
129
- TableName , TableRow as PgTableRow , TableSchema as PgTableSchema , Type , UpdateEvent ,
127
+ Cell as PgCell , ColumnSchema as PgColumnSchema , DeleteEvent , InsertEvent , TableId ,
128
+ TableName , Type as PgType , UpdateEvent ,
130
129
} ;
131
130
132
131
fn schema_single_pk ( table_id : TableId ) -> PgTableSchema {
@@ -136,14 +135,14 @@ mod tests {
136
135
vec ! [
137
136
PgColumnSchema {
138
137
name: "id" . to_string( ) ,
139
- typ: Type :: INT8 ,
138
+ typ: PgType :: INT8 ,
140
139
modifier: -1 ,
141
140
primary: true ,
142
141
nullable: false ,
143
142
} ,
144
143
PgColumnSchema {
145
144
name: "name" . to_string( ) ,
146
- typ: Type :: TEXT ,
145
+ typ: PgType :: TEXT ,
147
146
modifier: -1 ,
148
147
primary: false ,
149
148
nullable: true ,
@@ -165,21 +164,21 @@ mod tests {
165
164
vec ! [
166
165
PgColumnSchema {
167
166
name: "tenant_id" . to_string( ) ,
168
- typ: Type :: INT4 ,
167
+ typ: PgType :: INT4 ,
169
168
modifier: -1 ,
170
169
primary: true ,
171
170
nullable: false ,
172
171
} ,
173
172
PgColumnSchema {
174
173
name: "user_id" . to_string( ) ,
175
- typ: Type :: INT8 ,
174
+ typ: PgType :: INT8 ,
176
175
modifier: -1 ,
177
176
primary: true ,
178
177
nullable: false ,
179
178
} ,
180
179
PgColumnSchema {
181
180
name: "name" . to_string( ) ,
182
- typ: Type :: TEXT ,
181
+ typ: PgType :: TEXT ,
183
182
modifier: -1 ,
184
183
primary: false ,
185
184
nullable: true ,
0 commit comments