From 21d64604537d4538e7343c269c510f84019f41ee Mon Sep 17 00:00:00 2001 From: Fraser Savage Date: Wed, 17 May 2023 11:37:49 +0100 Subject: [PATCH] refactor(wal_inspect): Put the ref inside the option --- wal_inspect/src/lib.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wal_inspect/src/lib.rs b/wal_inspect/src/lib.rs index 9ceae88483..fda7527c47 100644 --- a/wal_inspect/src/lib.rs +++ b/wal_inspect/src/lib.rs @@ -133,13 +133,17 @@ where .entry(ns) .or_insert((self.new_write_sink)(ns)?); - write_batches_as_line_proto(sink, &self.table_name_index, table_batches.into_iter()) + write_batches_as_line_proto( + sink, + self.table_name_index.as_ref(), + table_batches.into_iter(), + ) } } fn write_batches_as_line_proto( sink: &mut W, - table_name_index: &Option>, + table_name_index: Option<&HashMap>, table_batches: B, ) -> Result<(), WriteError> where @@ -386,7 +390,7 @@ m2,t=bar v="arĂ¡n" 1"#, .map(|(i, (_table_name, batch))| (i as i64, batch)), ); - write_batches_as_line_proto(&mut sink, &None, batches.into_iter()) + write_batches_as_line_proto(&mut sink, None, batches.into_iter()) .expect("write back to line proto should succeed"); assert_eq!(