From 9e39e91139238466e1383f40dc3b8e1df5e58eac Mon Sep 17 00:00:00 2001 From: Marko Mikulicic Date: Fri, 12 Feb 2021 16:48:07 +0100 Subject: [PATCH] chore: Cleaning things in prep for rust 2021 Also remove a NUL byte in a test string literal; some editors drop them. --- influxdb_iox_client/src/client.rs | 2 +- influxdb_tsm/src/key.rs | 12 +++++++----- influxdb_tsm/src/reader.rs | 6 ++---- mutable_buffer/src/database.rs | 4 ++-- read_buffer/src/column.rs | 32 ++++++++++++------------------- src/commands/input.rs | 2 +- src/influxdb_ioxd/http.rs | 2 +- 7 files changed, 26 insertions(+), 34 deletions(-) diff --git a/influxdb_iox_client/src/client.rs b/influxdb_iox_client/src/client.rs index 0e553b594b..8d22fcb213 100644 --- a/influxdb_iox_client/src/client.rs +++ b/influxdb_iox_client/src/client.rs @@ -120,7 +120,7 @@ impl Client { #[derive(serde::Serialize)] struct WriterIdBody { id: u32, - }; + } let r = self .http diff --git a/influxdb_tsm/src/key.rs b/influxdb_tsm/src/key.rs index 26a3ccfde8..394d14441d 100644 --- a/influxdb_tsm/src/key.rs +++ b/influxdb_tsm/src/key.rs @@ -178,7 +178,7 @@ fn parse_tsm_field_key_value(rem_key: impl Iterator) -> Result) -> Result) -> Result panic!("{:?} {:?}", e, got_blocks), diff --git a/mutable_buffer/src/database.rs b/mutable_buffer/src/database.rs index dac44ce6ab..dbb12ea81f 100644 --- a/mutable_buffer/src/database.rs +++ b/mutable_buffer/src/database.rs @@ -1035,7 +1035,7 @@ mod tests { description: &'a str, predicate: Predicate, expected_tag_keys: Result>, - }; + } let test_cases = vec![ TestCase { @@ -1194,7 +1194,7 @@ mod tests { column_name: &'a str, predicate: Predicate, expected_column_values: Result>, - }; + } let test_cases = vec![ TestCase { diff --git a/read_buffer/src/column.rs b/read_buffer/src/column.rs index 2f78e729ab..4b9eb505b9 100644 --- a/read_buffer/src/column.rs +++ b/read_buffer/src/column.rs @@ -147,11 +147,9 @@ impl Column { pub fn value(&self, row_id: u32) -> Value<'_> { assert!( row_id < self.num_rows(), - format!( - "cannot read row {:?} from column with {:?} rows", - row_id, - self.num_rows() - ) + "cannot read row {:?} from column with {:?} rows", + row_id, + self.num_rows() ); match &self { @@ -168,11 +166,9 @@ impl Column { pub fn values(&self, row_ids: &[u32]) -> Values<'_> { assert!( row_ids.len() as u32 <= self.num_rows(), - format!( - "too many row ids {:?} provided for column with {:?} rows", - row_ids.len(), - self.num_rows() - ) + "too many row ids {:?} provided for column with {:?} rows", + row_ids.len(), + self.num_rows() ); match &self { @@ -210,11 +206,9 @@ impl Column { pub fn distinct_values(&self, row_ids: &[u32]) -> ValueSet<'_> { assert!( row_ids.len() as u32 <= self.num_rows(), - format!( - "too many row ids {:?} provided for column with {:?} rows", - row_ids.len(), - self.num_rows() - ) + "too many row ids {:?} provided for column with {:?} rows", + row_ids.len(), + self.num_rows() ); match &self { @@ -232,11 +226,9 @@ impl Column { pub fn encoded_values(&self, row_ids: &[u32], dst: EncodedValues) -> EncodedValues { assert!( row_ids.len() as u32 <= self.num_rows(), - format!( - "too many row ids {:?} provided for column with {:?} rows", - row_ids.len(), - self.num_rows() - ) + "too many row ids {:?} provided for column with {:?} rows", + row_ids.len(), + self.num_rows() ); match &self { diff --git a/src/commands/input.rs b/src/commands/input.rs index 7885ae4e07..912ddd74a8 100644 --- a/src/commands/input.rs +++ b/src/commands/input.rs @@ -273,7 +273,7 @@ impl InputPath { struct PathAndType { path: PathBuf, file_type: fs::FileType, - }; + } let mut paths = VecDeque::new(); let root_path = root_path.into(); diff --git a/src/influxdb_ioxd/http.rs b/src/influxdb_ioxd/http.rs index 5b9f4ce6a0..60ea99f98a 100644 --- a/src/influxdb_ioxd/http.rs +++ b/src/influxdb_ioxd/http.rs @@ -608,7 +608,7 @@ async fn set_writer( #[derive(Serialize, Deserialize)] struct WriterIdBody { id: u32, - }; + } let req: WriterIdBody = serde_json::from_slice(body.as_ref()).context(InvalidRequestBody)?; // Set the writer ID