@@ -36,9 +36,7 @@ macro_rules! convert_array_values_to_cells {
3636 ( $rows: expr, $arr: expr, $typ: ty) => {
3737 if let Some ( a) = $arr. as_any( ) . downcast_ref:: <$typ>( ) {
3838 for i in 0 ..$rows. len( ) {
39- let cell = Cell :: from( a. value( i) . to_string( ) )
40- . bg( tailwind:: BLACK )
41- . fg( tailwind:: WHITE ) ;
39+ let cell = Cell :: from( a. value( i) . to_string( ) ) ;
4240 $rows[ i] . push( cell) ;
4341 }
4442 }
@@ -49,9 +47,7 @@ macro_rules! convert_binary_array_values_to_cells {
4947 ( $rows: expr, $arr: expr, $typ: ty) => {
5048 if let Some ( a) = $arr. as_any( ) . downcast_ref:: <$typ>( ) {
5149 for i in 0 ..$rows. len( ) {
52- let cell = Cell :: from( format!( "{:?}" , a. value( i) ) )
53- . bg( tailwind:: BLACK )
54- . fg( tailwind:: WHITE ) ;
50+ let cell = Cell :: from( format!( "{:?}" , a. value( i) ) ) ;
5551 $rows[ i] . push( cell) ;
5652 }
5753 }
@@ -71,11 +67,7 @@ pub fn record_batch_to_table_header_cells(record_batch: &RecordBatch) -> Vec<Cel
7167
7268pub fn create_row_number_cells ( record_batch : & RecordBatch ) -> Vec < Cell < ' _ > > {
7369 let cells: Vec < Cell > = ( 0 ..record_batch. num_rows ( ) )
74- . map ( |i| {
75- Cell :: new ( i. to_string ( ) )
76- . bg ( tailwind:: BLACK )
77- . fg ( tailwind:: WHITE )
78- } )
70+ . map ( |i| Cell :: new ( i. to_string ( ) ) )
7971 . collect ( ) ;
8072 cells
8173}
@@ -264,13 +256,9 @@ mod tests {
264256 vec![
265257 Cell :: new( "#" ) . bg( tailwind:: ORANGE . c300) . fg( tailwind:: BLACK ) ,
266258 Cell :: new( "a" )
267- . bg( tailwind:: BLACK )
268- . fg( tailwind:: WHITE )
269259 . bg( tailwind:: ORANGE . c300)
270260 . fg( tailwind:: BLACK ) ,
271261 Cell :: new( "b" )
272- . bg( tailwind:: BLACK )
273- . fg( tailwind:: WHITE )
274262 . bg( tailwind:: ORANGE . c300)
275263 . fg( tailwind:: BLACK )
276264 ]
@@ -285,16 +273,16 @@ mod tests {
285273 let table_cells = record_batch_to_table_row_cells ( & batch) . unwrap ( ) ;
286274 let expected = vec ! [
287275 vec![
288- Cell :: new( "0" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
289- Cell :: new( "a" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
276+ Cell :: new( "0" ) ,
277+ Cell :: new( "a" ) ,
290278 ] ,
291279 vec![
292- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
293- Cell :: new( "b" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
280+ Cell :: new( "1" ) ,
281+ Cell :: new( "b" ) ,
294282 ] ,
295283 vec![
296- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
297- Cell :: new( "c" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
284+ Cell :: new( "2" ) ,
285+ Cell :: new( "c" ) ,
298286 ] ,
299287 ] ;
300288 assert_eq ! ( table_cells, expected) ;
@@ -304,16 +292,16 @@ mod tests {
304292 let a_table_cells = record_batch_to_table_row_cells ( & batch) . unwrap ( ) ;
305293 let expected = vec ! [
306294 vec![
307- Cell :: new( "0" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
308- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
295+ Cell :: new( "0" ) ,
296+ Cell :: new( "1" ) ,
309297 ] ,
310298 vec![
311- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
312- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
299+ Cell :: new( "1" ) ,
300+ Cell :: new( "2" ) ,
313301 ] ,
314302 vec![
315- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
316- Cell :: new( "3" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
303+ Cell :: new( "2" ) ,
304+ Cell :: new( "3" ) ,
317305 ] ,
318306 ] ;
319307 assert_eq ! ( a_table_cells, expected) ;
@@ -323,16 +311,16 @@ mod tests {
323311 let a_table_cells = record_batch_to_table_row_cells ( & batch) . unwrap ( ) ;
324312 let expected = vec ! [
325313 vec![
326- Cell :: new( "0" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
327- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
314+ Cell :: new( "0" ) ,
315+ Cell :: new( "1" ) ,
328316 ] ,
329317 vec![
330- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
331- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
318+ Cell :: new( "1" ) ,
319+ Cell :: new( "2" ) ,
332320 ] ,
333321 vec![
334- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
335- Cell :: new( "3" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
322+ Cell :: new( "2" ) ,
323+ Cell :: new( "3" ) ,
336324 ] ,
337325 ] ;
338326 assert_eq ! ( a_table_cells, expected) ;
@@ -342,16 +330,16 @@ mod tests {
342330 let a_table_cells = record_batch_to_table_row_cells ( & batch) . unwrap ( ) ;
343331 let expected = vec ! [
344332 vec![
345- Cell :: new( "0" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
346- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
333+ Cell :: new( "0" ) ,
334+ Cell :: new( "1" ) ,
347335 ] ,
348336 vec![
349- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
350- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
337+ Cell :: new( "1" ) ,
338+ Cell :: new( "2" ) ,
351339 ] ,
352340 vec![
353- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
354- Cell :: new( "3" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
341+ Cell :: new( "2" ) ,
342+ Cell :: new( "3" ) ,
355343 ] ,
356344 ] ;
357345 assert_eq ! ( a_table_cells, expected) ;
@@ -361,16 +349,16 @@ mod tests {
361349 let a_table_cells = record_batch_to_table_row_cells ( & batch) . unwrap ( ) ;
362350 let expected = vec ! [
363351 vec![
364- Cell :: new( "0" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
365- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
352+ Cell :: new( "0" ) ,
353+ Cell :: new( "1" ) ,
366354 ] ,
367355 vec![
368- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
369- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
356+ Cell :: new( "1" ) ,
357+ Cell :: new( "2" ) ,
370358 ] ,
371359 vec![
372- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
373- Cell :: new( "3" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
360+ Cell :: new( "2" ) ,
361+ Cell :: new( "3" ) ,
374362 ] ,
375363 ] ;
376364 assert_eq ! ( a_table_cells, expected) ;
@@ -380,16 +368,16 @@ mod tests {
380368 let a_table_cells = record_batch_to_table_row_cells ( & batch) . unwrap ( ) ;
381369 let expected = vec ! [
382370 vec![
383- Cell :: new( "0" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
384- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
371+ Cell :: new( "0" ) ,
372+ Cell :: new( "1" ) ,
385373 ] ,
386374 vec![
387- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
388- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
375+ Cell :: new( "1" ) ,
376+ Cell :: new( "2" ) ,
389377 ] ,
390378 vec![
391- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
392- Cell :: new( "3" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
379+ Cell :: new( "2" ) ,
380+ Cell :: new( "3" ) ,
393381 ] ,
394382 ] ;
395383 assert_eq ! ( a_table_cells, expected) ;
@@ -399,16 +387,16 @@ mod tests {
399387 let a_table_cells = record_batch_to_table_row_cells ( & batch) . unwrap ( ) ;
400388 let expected = vec ! [
401389 vec![
402- Cell :: new( "0" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
403- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
390+ Cell :: new( "0" ) ,
391+ Cell :: new( "1" ) ,
404392 ] ,
405393 vec![
406- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
407- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
394+ Cell :: new( "1" ) ,
395+ Cell :: new( "2" ) ,
408396 ] ,
409397 vec![
410- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
411- Cell :: new( "3" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
398+ Cell :: new( "2" ) ,
399+ Cell :: new( "3" ) ,
412400 ] ,
413401 ] ;
414402 assert_eq ! ( a_table_cells, expected) ;
@@ -418,16 +406,16 @@ mod tests {
418406 let a_table_cells = record_batch_to_table_row_cells ( & batch) . unwrap ( ) ;
419407 let expected = vec ! [
420408 vec![
421- Cell :: new( "0" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
422- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
409+ Cell :: new( "0" ) ,
410+ Cell :: new( "1" ) ,
423411 ] ,
424412 vec![
425- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
426- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
413+ Cell :: new( "1" ) ,
414+ Cell :: new( "2" ) ,
427415 ] ,
428416 vec![
429- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
430- Cell :: new( "3" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
417+ Cell :: new( "2" ) ,
418+ Cell :: new( "3" ) ,
431419 ] ,
432420 ] ;
433421 assert_eq ! ( a_table_cells, expected) ;
@@ -437,16 +425,16 @@ mod tests {
437425 let a_table_cells = record_batch_to_table_row_cells ( & batch) . unwrap ( ) ;
438426 let expected = vec ! [
439427 vec![
440- Cell :: new( "0" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
441- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
428+ Cell :: new( "0" ) ,
429+ Cell :: new( "1" ) ,
442430 ] ,
443431 vec![
444- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
445- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
432+ Cell :: new( "1" ) ,
433+ Cell :: new( "2" ) ,
446434 ] ,
447435 vec![
448- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
449- Cell :: new( "3" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
436+ Cell :: new( "2" ) ,
437+ Cell :: new( "3" ) ,
450438 ] ,
451439 ] ;
452440 assert_eq ! ( a_table_cells, expected) ;
@@ -460,19 +448,19 @@ mod tests {
460448 let a_table_cells = record_batch_to_table_row_cells ( & batch) . unwrap ( ) ;
461449 let expected = vec ! [
462450 vec![
463- Cell :: new( "0" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
464- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
465- Cell :: new( "a" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
451+ Cell :: new( "0" ) ,
452+ Cell :: new( "1" ) ,
453+ Cell :: new( "a" ) ,
466454 ] ,
467455 vec![
468- Cell :: new( "1" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
469- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
470- Cell :: new( "b" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
456+ Cell :: new( "1" ) ,
457+ Cell :: new( "2" ) ,
458+ Cell :: new( "b" ) ,
471459 ] ,
472460 vec![
473- Cell :: new( "2" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
474- Cell :: new( "3" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
475- Cell :: new( "c" ) . bg ( tailwind :: BLACK ) . fg ( tailwind :: WHITE ) ,
461+ Cell :: new( "2" ) ,
462+ Cell :: new( "3" ) ,
463+ Cell :: new( "c" ) ,
476464 ] ,
477465 ] ;
478466 assert_eq ! ( a_table_cells, expected) ;
0 commit comments