From a5e5dfda6fb1c1af3873cba830f9ce7aff1594c9 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Thu, 29 Sep 2022 13:02:57 +0200 Subject: [PATCH 1/3] refactor: remove dbg! Left over from debugging. --- write_buffer/src/kafka/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/write_buffer/src/kafka/mod.rs b/write_buffer/src/kafka/mod.rs index ff98e473d4..99aad39d1f 100644 --- a/write_buffer/src/kafka/mod.rs +++ b/write_buffer/src/kafka/mod.rs @@ -326,7 +326,7 @@ impl WriteBufferStreamHandler for RSKafkaStreamHandler { async fn seek(&mut self, sequence_number: SequenceNumber) -> Result<(), WriteBufferError> { let offset = sequence_number.get(); let current = self.partition_client.get_offset(OffsetAt::Latest).await?; - if dbg!(offset) > dbg!(current) { + if offset > current { return Err(WriteBufferError::sequence_number_after_watermark(format!( "attempted to seek to offset {offset}, but current high \ watermark for partition {p} is {current}", From cd4087e00df887a0a46011c08d97ad52e0880e79 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Thu, 29 Sep 2022 13:03:20 +0200 Subject: [PATCH 2/3] style: add no todo!() or dbg!() lints Some crates had theme, some not - lets be consistent and have the compiler spot dbg!() and todo!() macro calls - they should never be in prod code! --- arrow_util/src/lib.rs | 9 +++++++++ arrow_util/src/string.rs | 1 + arrow_util/src/test_util.rs | 2 +- backoff/src/lib.rs | 4 +++- cache_system/src/lib.rs | 4 +++- clap_blocks/src/lib.rs | 4 +++- client_util/src/lib.rs | 4 +++- compactor/src/lib.rs | 4 +++- data_types/src/lib.rs | 4 +++- dml/src/lib.rs | 4 +++- executor/src/lib.rs | 6 ++++-- garbage_collector/src/lib.rs | 4 +++- grpc-binary-logger/src/lib.rs | 4 +++- influxdb2_client/src/lib.rs | 4 +++- influxdb_influxql_parser/src/lib.rs | 4 +++- influxdb_iox_client/src/lib.rs | 4 +++- influxdb_line_protocol/src/lib.rs | 4 +++- influxdb_storage_client/src/lib.rs | 4 +++- influxdb_tsm/src/lib.rs | 4 +++- influxrpc_parser/src/lib.rs | 4 +++- ingester/src/lib.rs | 6 +++++- iox_catalog/src/lib.rs | 4 +++- iox_data_generator/src/lib.rs | 4 +++- iox_query/src/lib.rs | 4 +++- iox_tests/src/lib.rs | 4 +++- iox_time/src/lib.rs | 4 +++- ioxd_garbage_collector/src/lib.rs | 4 +++- metric/src/lib.rs | 4 +++- metric_exporters/src/lib.rs | 4 +++- mutable_batch/src/lib.rs | 4 +++- mutable_batch_lp/src/lib.rs | 4 +++- mutable_batch_pb/src/lib.rs | 4 +++- packers/src/lib.rs | 4 +++- panic_logging/src/lib.rs | 4 +++- predicate/src/lib.rs | 4 +++- querier/src/lib.rs | 4 +++- query_functions/src/lib.rs | 4 +++- read_buffer/src/lib.rs | 4 +++- router/src/lib.rs | 1 + router/src/namespace_cache/sharded_cache.rs | 4 ++-- service_grpc_catalog/src/lib.rs | 4 +++- service_grpc_object_store/src/lib.rs | 4 +++- sqlx-hotswap-pool/src/lib.rs | 4 +++- test_helpers/src/lib.rs | 4 +++- trace/src/lib.rs | 4 +++- trace_exporters/src/lib.rs | 4 +++- trace_http/src/lib.rs | 4 +++- tracker/src/lib.rs | 4 +++- trogging/src/lib.rs | 4 +++- write_buffer/src/lib.rs | 2 ++ 50 files changed, 151 insertions(+), 48 deletions(-) diff --git a/arrow_util/src/lib.rs b/arrow_util/src/lib.rs index c1f4dd1e38..401cfe7eab 100644 --- a/arrow_util/src/lib.rs +++ b/arrow_util/src/lib.rs @@ -1,5 +1,14 @@ #![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)] #![allow(clippy::clone_on_ref_ptr)] +#![warn( + missing_copy_implementations, + missing_debug_implementations, + clippy::explicit_iter_loop, + clippy::future_not_send, + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro +)] pub mod bitset; pub mod dictionary; diff --git a/arrow_util/src/string.rs b/arrow_util/src/string.rs index d99f973510..387e6d3da3 100644 --- a/arrow_util/src/string.rs +++ b/arrow_util/src/string.rs @@ -175,6 +175,7 @@ impl PackedStringArray { } } +#[derive(Debug)] pub struct PackedStringIterator<'a, K> { array: &'a PackedStringArray, index: usize, diff --git a/arrow_util/src/test_util.rs b/arrow_util/src/test_util.rs index 904f4fd5fb..cee66a4717 100644 --- a/arrow_util/src/test_util.rs +++ b/arrow_util/src/test_util.rs @@ -80,7 +80,7 @@ pub fn sort_record_batch(batch: RecordBatch) -> RecordBatch { .columns() .iter() .map(|col| SortColumn { - values: col.clone(), + values: Arc::clone(col), options: Some(SortOptions { descending: false, nulls_first: false, diff --git a/backoff/src/lib.rs b/backoff/src/lib.rs index 92b0f0387c..e108320b2e 100644 --- a/backoff/src/lib.rs +++ b/backoff/src/lib.rs @@ -7,7 +7,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use observability_deps::tracing::info; use rand::prelude::*; diff --git a/cache_system/src/lib.rs b/cache_system/src/lib.rs index 1cd37a7330..842125b9c2 100644 --- a/cache_system/src/lib.rs +++ b/cache_system/src/lib.rs @@ -6,7 +6,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] pub mod addressable_heap; diff --git a/clap_blocks/src/lib.rs b/clap_blocks/src/lib.rs index 018a119c36..3cf8f93ad4 100644 --- a/clap_blocks/src/lib.rs +++ b/clap_blocks/src/lib.rs @@ -8,7 +8,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] pub mod catalog_dsn; pub mod compactor; diff --git a/client_util/src/lib.rs b/client_util/src/lib.rs index 57e9e4e057..487680b699 100644 --- a/client_util/src/lib.rs +++ b/client_util/src/lib.rs @@ -11,7 +11,9 @@ clippy::todo, clippy::dbg_macro, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] #![allow(clippy::missing_docs_in_private_items)] diff --git a/compactor/src/lib.rs b/compactor/src/lib.rs index 13782d2ad5..8be5b71afd 100644 --- a/compactor/src/lib.rs +++ b/compactor/src/lib.rs @@ -7,7 +7,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] pub(crate) mod cold; diff --git a/data_types/src/lib.rs b/data_types/src/lib.rs index 68480f1608..5af408403b 100644 --- a/data_types/src/lib.rs +++ b/data_types/src/lib.rs @@ -8,7 +8,9 @@ missing_docs, clippy::explicit_iter_loop, clippy::future_not_send, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use influxdb_line_protocol::FieldValue; diff --git a/dml/src/lib.rs b/dml/src/lib.rs index 1b8f08a27e..66dcf36bfe 100644 --- a/dml/src/lib.rs +++ b/dml/src/lib.rs @@ -8,7 +8,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use std::time::Duration; diff --git a/executor/src/lib.rs b/executor/src/lib.rs index 7de6a969dc..cffaac1238 100644 --- a/executor/src/lib.rs +++ b/executor/src/lib.rs @@ -8,7 +8,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use parking_lot::Mutex; @@ -621,7 +623,7 @@ mod tests { async fn wait_for_tasks(exec: &DedicatedExecutor, num: usize) { tokio::time::timeout(Duration::from_secs(1), async { loop { - if dbg!(exec.tasks()) == num { + if exec.tasks() == num { return; } tokio::time::sleep(Duration::from_millis(1)).await; diff --git a/garbage_collector/src/lib.rs b/garbage_collector/src/lib.rs index 977e221cf9..d2173d42dd 100644 --- a/garbage_collector/src/lib.rs +++ b/garbage_collector/src/lib.rs @@ -11,7 +11,9 @@ clippy::todo, clippy::dbg_macro, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] #![allow(clippy::missing_docs_in_private_items)] diff --git a/grpc-binary-logger/src/lib.rs b/grpc-binary-logger/src/lib.rs index 938d0468c7..e29efad3cc 100644 --- a/grpc-binary-logger/src/lib.rs +++ b/grpc-binary-logger/src/lib.rs @@ -8,7 +8,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] mod predicate; diff --git a/influxdb2_client/src/lib.rs b/influxdb2_client/src/lib.rs index 9500dcee8f..09ecaf34de 100644 --- a/influxdb2_client/src/lib.rs +++ b/influxdb2_client/src/lib.rs @@ -7,7 +7,9 @@ missing_docs, clippy::explicit_iter_loop, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] //! # influxdb2_client diff --git a/influxdb_influxql_parser/src/lib.rs b/influxdb_influxql_parser/src/lib.rs index 3198f2d3ea..6cbe85b958 100644 --- a/influxdb_influxql_parser/src/lib.rs +++ b/influxdb_influxql_parser/src/lib.rs @@ -9,7 +9,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use crate::common::statement_terminator; diff --git a/influxdb_iox_client/src/lib.rs b/influxdb_iox_client/src/lib.rs index 1ed7700e86..2147cdda7b 100644 --- a/influxdb_iox_client/src/lib.rs +++ b/influxdb_iox_client/src/lib.rs @@ -11,7 +11,9 @@ clippy::todo, clippy::dbg_macro, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] #![allow(clippy::missing_docs_in_private_items)] diff --git a/influxdb_line_protocol/src/lib.rs b/influxdb_line_protocol/src/lib.rs index d90360d70a..07d9ca14ea 100644 --- a/influxdb_line_protocol/src/lib.rs +++ b/influxdb_line_protocol/src/lib.rs @@ -13,7 +13,9 @@ missing_debug_implementations, clippy::explicit_iter_loop, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] pub mod builder; diff --git a/influxdb_storage_client/src/lib.rs b/influxdb_storage_client/src/lib.rs index 1e3816be69..5c4b700731 100644 --- a/influxdb_storage_client/src/lib.rs +++ b/influxdb_storage_client/src/lib.rs @@ -11,7 +11,9 @@ clippy::todo, clippy::dbg_macro, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] #![allow(clippy::missing_docs_in_private_items)] diff --git a/influxdb_tsm/src/lib.rs b/influxdb_tsm/src/lib.rs index ef78c843b2..fc4dab6455 100644 --- a/influxdb_tsm/src/lib.rs +++ b/influxdb_tsm/src/lib.rs @@ -4,7 +4,9 @@ missing_debug_implementations, clippy::explicit_iter_loop, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] pub mod encoders; diff --git a/influxrpc_parser/src/lib.rs b/influxrpc_parser/src/lib.rs index 42d406b428..d35f234d8a 100644 --- a/influxrpc_parser/src/lib.rs +++ b/influxrpc_parser/src/lib.rs @@ -7,7 +7,9 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::str_to_string, - clippy::string_to_string + clippy::string_to_string, + clippy::todo, + clippy::dbg_macro )] pub mod predicate; diff --git a/ingester/src/lib.rs b/ingester/src/lib.rs index 29135fb6f2..f2ebc67cc0 100644 --- a/ingester/src/lib.rs +++ b/ingester/src/lib.rs @@ -7,10 +7,14 @@ missing_copy_implementations, missing_debug_implementations, missing_docs, + clippy::todo, + clippy::dbg_macro, clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] pub(crate) mod compact; diff --git a/iox_catalog/src/lib.rs b/iox_catalog/src/lib.rs index 4d20e5fc5c..f0911ce20b 100644 --- a/iox_catalog/src/lib.rs +++ b/iox_catalog/src/lib.rs @@ -8,7 +8,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use crate::interface::{ diff --git a/iox_data_generator/src/lib.rs b/iox_data_generator/src/lib.rs index 3f5c4a56ed..eb4b08e942 100644 --- a/iox_data_generator/src/lib.rs +++ b/iox_data_generator/src/lib.rs @@ -24,7 +24,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use crate::{agent::Agent, tag_set::GeneratedTagSets}; diff --git a/iox_query/src/lib.rs b/iox_query/src/lib.rs index 40136d102f..a0bd37a68b 100644 --- a/iox_query/src/lib.rs +++ b/iox_query/src/lib.rs @@ -5,7 +5,9 @@ clippy::explicit_iter_loop, clippy::use_self, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] use async_trait::async_trait; diff --git a/iox_tests/src/lib.rs b/iox_tests/src/lib.rs index 422082c95c..3589e1242e 100644 --- a/iox_tests/src/lib.rs +++ b/iox_tests/src/lib.rs @@ -7,7 +7,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] pub mod util; diff --git a/iox_time/src/lib.rs b/iox_time/src/lib.rs index d7286d2a4e..0e9b175598 100644 --- a/iox_time/src/lib.rs +++ b/iox_time/src/lib.rs @@ -4,7 +4,9 @@ clippy::explicit_iter_loop, clippy::use_self, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] use chrono::{DateTime, TimeZone, Timelike, Utc}; diff --git a/ioxd_garbage_collector/src/lib.rs b/ioxd_garbage_collector/src/lib.rs index f4e9eae289..f009e2fad6 100644 --- a/ioxd_garbage_collector/src/lib.rs +++ b/ioxd_garbage_collector/src/lib.rs @@ -11,7 +11,9 @@ clippy::todo, clippy::dbg_macro, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] #![allow(clippy::missing_docs_in_private_items)] diff --git a/metric/src/lib.rs b/metric/src/lib.rs index 9c6dad43b7..b6730ebd83 100644 --- a/metric/src/lib.rs +++ b/metric/src/lib.rs @@ -107,7 +107,9 @@ missing_debug_implementations, clippy::explicit_iter_loop, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use parking_lot::Mutex; diff --git a/metric_exporters/src/lib.rs b/metric_exporters/src/lib.rs index ac26bd3fa6..719ec807a3 100644 --- a/metric_exporters/src/lib.rs +++ b/metric_exporters/src/lib.rs @@ -3,7 +3,9 @@ missing_debug_implementations, clippy::explicit_iter_loop, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use metric::{Attributes, MetricKind, Observation}; diff --git a/mutable_batch/src/lib.rs b/mutable_batch/src/lib.rs index c62d6d0760..cf2eb3837a 100644 --- a/mutable_batch/src/lib.rs +++ b/mutable_batch/src/lib.rs @@ -6,7 +6,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] //! A mutable data structure for a collection of writes. diff --git a/mutable_batch_lp/src/lib.rs b/mutable_batch_lp/src/lib.rs index c7c16ab00b..a345aaab21 100644 --- a/mutable_batch_lp/src/lib.rs +++ b/mutable_batch_lp/src/lib.rs @@ -8,7 +8,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use hashbrown::{hash_map::Entry, HashMap, HashSet}; diff --git a/mutable_batch_pb/src/lib.rs b/mutable_batch_pb/src/lib.rs index 5251b1a280..da79d4fb1f 100644 --- a/mutable_batch_pb/src/lib.rs +++ b/mutable_batch_pb/src/lib.rs @@ -8,7 +8,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] pub mod decode; diff --git a/packers/src/lib.rs b/packers/src/lib.rs index e38d7145a1..885dee7e89 100644 --- a/packers/src/lib.rs +++ b/packers/src/lib.rs @@ -4,7 +4,9 @@ missing_debug_implementations, clippy::explicit_iter_loop, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] pub mod packers; diff --git a/panic_logging/src/lib.rs b/panic_logging/src/lib.rs index 06583adf64..016ffbdf91 100644 --- a/panic_logging/src/lib.rs +++ b/panic_logging/src/lib.rs @@ -6,7 +6,9 @@ missing_debug_implementations, clippy::explicit_iter_loop, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use std::{fmt, panic, sync::Arc}; diff --git a/predicate/src/lib.rs b/predicate/src/lib.rs index 1bc260e7f8..03b52e521d 100644 --- a/predicate/src/lib.rs +++ b/predicate/src/lib.rs @@ -5,7 +5,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] pub mod delete_expr; diff --git a/querier/src/lib.rs b/querier/src/lib.rs index 6298941313..b6b9bf1e8c 100644 --- a/querier/src/lib.rs +++ b/querier/src/lib.rs @@ -6,7 +6,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] mod cache; diff --git a/query_functions/src/lib.rs b/query_functions/src/lib.rs index cf6c52b38f..75d2d3eea3 100644 --- a/query_functions/src/lib.rs +++ b/query_functions/src/lib.rs @@ -6,7 +6,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use datafusion::{ diff --git a/read_buffer/src/lib.rs b/read_buffer/src/lib.rs index 71a5445b25..41734bb54f 100644 --- a/read_buffer/src/lib.rs +++ b/read_buffer/src/lib.rs @@ -3,7 +3,9 @@ clippy::clone_on_ref_ptr, clippy::use_self, clippy::str_to_string, - clippy::string_to_string + clippy::string_to_string, + clippy::todo, + clippy::dbg_macro )] #![allow(dead_code, clippy::too_many_arguments)] mod chunk; diff --git a/router/src/lib.rs b/router/src/lib.rs index c0f232d926..24cf7c77d0 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -20,6 +20,7 @@ missing_docs, clippy::todo, clippy::dbg_macro, + clippy::explicit_iter_loop, clippy::clone_on_ref_ptr, clippy::future_not_send )] diff --git a/router/src/namespace_cache/sharded_cache.rs b/router/src/namespace_cache/sharded_cache.rs index f33bdc022e..235cd139ae 100644 --- a/router/src/namespace_cache/sharded_cache.rs +++ b/router/src/namespace_cache/sharded_cache.rs @@ -84,12 +84,12 @@ mod tests { .collect::>(); // The cache should be empty. - for (name, _) in names.iter() { + for name in names.keys() { assert!(cache.get_schema(name).is_none()); } // Populate the cache - for (name, id) in names.iter() { + for (name, id) in &names { let schema = schema_with_id(*id as _); assert!(cache.put_schema(name.clone(), schema).is_none()); } diff --git a/service_grpc_catalog/src/lib.rs b/service_grpc_catalog/src/lib.rs index d33c995a4c..66bedf8892 100644 --- a/service_grpc_catalog/src/lib.rs +++ b/service_grpc_catalog/src/lib.rs @@ -8,7 +8,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use data_types::{PartitionId, TableId}; diff --git a/service_grpc_object_store/src/lib.rs b/service_grpc_object_store/src/lib.rs index 8b5321b050..f5f515bf35 100644 --- a/service_grpc_object_store/src/lib.rs +++ b/service_grpc_object_store/src/lib.rs @@ -9,7 +9,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use futures::{stream::BoxStream, StreamExt}; diff --git a/sqlx-hotswap-pool/src/lib.rs b/sqlx-hotswap-pool/src/lib.rs index 9cc87153de..975c997bbc 100644 --- a/sqlx-hotswap-pool/src/lib.rs +++ b/sqlx-hotswap-pool/src/lib.rs @@ -10,7 +10,9 @@ clippy::todo, clippy::dbg_macro, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] #![allow(clippy::missing_docs_in_private_items, clippy::type_complexity)] diff --git a/test_helpers/src/lib.rs b/test_helpers/src/lib.rs index ea543eabd4..76a7797760 100644 --- a/test_helpers/src/lib.rs +++ b/test_helpers/src/lib.rs @@ -4,7 +4,9 @@ missing_debug_implementations, clippy::explicit_iter_loop, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] use std::{ diff --git a/trace/src/lib.rs b/trace/src/lib.rs index 02319bfee0..e83dc4534f 100644 --- a/trace/src/lib.rs +++ b/trace/src/lib.rs @@ -4,7 +4,9 @@ clippy::explicit_iter_loop, clippy::use_self, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] use std::{any::Any, collections::VecDeque}; diff --git a/trace_exporters/src/lib.rs b/trace_exporters/src/lib.rs index a7f38be45a..6e544cf254 100644 --- a/trace_exporters/src/lib.rs +++ b/trace_exporters/src/lib.rs @@ -4,7 +4,9 @@ clippy::explicit_iter_loop, clippy::use_self, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] use crate::export::AsyncExporter; diff --git a/trace_http/src/lib.rs b/trace_http/src/lib.rs index c68e99fea5..629e12d57a 100644 --- a/trace_http/src/lib.rs +++ b/trace_http/src/lib.rs @@ -4,7 +4,9 @@ clippy::explicit_iter_loop, clippy::use_self, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] mod classify; diff --git a/tracker/src/lib.rs b/tracker/src/lib.rs index c9245ccfc7..31096cc63f 100644 --- a/tracker/src/lib.rs +++ b/tracker/src/lib.rs @@ -4,7 +4,9 @@ clippy::explicit_iter_loop, clippy::use_self, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro )] mod async_semaphore; diff --git a/trogging/src/lib.rs b/trogging/src/lib.rs index 6ec55d9eaa..0d7715d50f 100644 --- a/trogging/src/lib.rs +++ b/trogging/src/lib.rs @@ -7,7 +7,9 @@ clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro )] #[cfg(feature = "clap")] diff --git a/write_buffer/src/lib.rs b/write_buffer/src/lib.rs index 2405e03729..8b75e93395 100644 --- a/write_buffer/src/lib.rs +++ b/write_buffer/src/lib.rs @@ -2,6 +2,8 @@ #![warn( missing_copy_implementations, missing_debug_implementations, + clippy::todo, + clippy::dbg_macro, clippy::explicit_iter_loop, clippy::future_not_send, clippy::use_self, From 5a5f9d104b7cfe1442f7f1a9b9851b027692356f Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Thu, 29 Sep 2022 13:06:24 +0200 Subject: [PATCH 3/3] refactor(read_buffer): todo!() -> unimplemented!() todo!() is useful for incremental work (telling the compiler to shut up during dev work). unimplemented!() should be used for prod code that is not yet implemented but expected to be deployed. It signifies "this isn't implemented but doesn't need doing now". --- read_buffer/src/column.rs | 36 +++++++++---------- read_buffer/src/column/encoding/scalar/rle.rs | 8 ++--- .../src/column/encoding/string/dictionary.rs | 8 ++--- read_buffer/src/row_group.rs | 2 +- read_buffer/src/table.rs | 6 ++-- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/read_buffer/src/column.rs b/read_buffer/src/column.rs index 8391708cc0..fd623ee236 100644 --- a/read_buffer/src/column.rs +++ b/read_buffer/src/column.rs @@ -188,7 +188,7 @@ impl Column { Some((min, max)) => (OwnedValue::Boolean(min), OwnedValue::Boolean(max)), None => (OwnedValue::new_null(), OwnedValue::new_null()), }, - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -216,11 +216,11 @@ impl Column { } pub fn column_min(&self) -> Value<'_> { - todo!() + unimplemented!() } pub fn column_max(&self) -> Value<'_> { - todo!() + unimplemented!() } // @@ -242,7 +242,7 @@ impl Column { Self::Integer(_, data) => data.value(row_id), Self::Unsigned(_, data) => data.value(row_id), Self::Bool(_, data) => data.value(row_id), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -261,7 +261,7 @@ impl Column { Self::Integer(_, data) => data.values(row_ids), Self::Unsigned(_, data) => data.values(row_ids), Self::Bool(_, data) => data.values(row_ids), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -293,7 +293,7 @@ impl Column { Self::Integer(_, data) => data.all_values(), Self::Unsigned(_, data) => data.all_values(), Self::Bool(_, data) => data.all_values(), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -313,7 +313,7 @@ impl Column { pub fn decode_id(&self, encoded_id: u32) -> Value<'_> { match &self { Self::String(_, data) => data.decode_id(encoded_id), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), _ => panic!("unsupported operation"), } } @@ -412,7 +412,7 @@ impl Column { Self::Integer(_, data) => data.row_ids_filter(op, value.scalar(), dst), Self::Unsigned(_, data) => data.row_ids_filter(op, value.scalar(), dst), Self::Bool(_, data) => data.row_ids_filter(op, value.bool(), dst), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), }; if row_ids.is_empty() { @@ -471,7 +471,7 @@ impl Column { data.row_ids_filter_range((&low.0, low.1.scalar()), (&high.0, high.1.scalar()), dst) } Self::Bool(_, _) => unimplemented!("filter_range not supported on boolean column"), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), }; if row_ids.is_empty() { @@ -555,7 +555,7 @@ impl Column { Value::Boolean(b) => meta.might_contain_value(*b), v => panic!("cannot compare boolean to {:?}", v), }, - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -624,7 +624,7 @@ impl Column { v => panic!("cannot compare on boolean column using {:?}", v), } } - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -648,7 +648,7 @@ impl Column { Self::Integer(meta, _) => meta.match_no_values(op, value.scalar().as_i64()), Self::Unsigned(meta, _) => meta.match_no_values(op, value.scalar().as_u64()), Self::Bool(meta, _) => meta.match_no_values(op, value.bool()), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -666,7 +666,7 @@ impl Column { Self::Integer(_, data) => data.min(row_ids), Self::Unsigned(_, data) => data.min(row_ids), Self::Bool(_, data) => data.min(row_ids), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -680,7 +680,7 @@ impl Column { Self::Integer(_, data) => data.max(row_ids), Self::Unsigned(_, data) => data.max(row_ids), Self::Bool(_, data) => data.max(row_ids), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -710,7 +710,7 @@ impl Column { Self::Integer(_, data) => data.count(row_ids), Self::Unsigned(_, data) => data.count(row_ids), Self::Bool(_, data) => data.count(row_ids), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -726,7 +726,7 @@ impl Column { Self::Integer(_, data) => data.contains_null(), Self::Unsigned(_, data) => data.contains_null(), Self::Bool(_, data) => data.contains_null(), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -739,7 +739,7 @@ impl Column { Self::Integer(_, data) => data.has_non_null_value(row_ids), Self::Unsigned(_, data) => data.has_non_null_value(row_ids), Self::Bool(_, data) => data.has_non_null_value(row_ids), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } @@ -751,7 +751,7 @@ impl Column { Self::Integer(_, data) => data.has_any_non_null_value(), Self::Unsigned(_, data) => data.has_any_non_null_value(), Self::Bool(_, data) => data.has_any_non_null_value(), - Self::ByteArray(_, _) => todo!(), + Self::ByteArray(_, _) => unimplemented!(), } } diff --git a/read_buffer/src/column/encoding/scalar/rle.rs b/read_buffer/src/column/encoding/scalar/rle.rs index b7dca24b11..76c932ee80 100644 --- a/read_buffer/src/column/encoding/scalar/rle.rs +++ b/read_buffer/src/column/encoding/scalar/rle.rs @@ -607,19 +607,19 @@ where } fn count(&self, _row_ids: &[u32]) -> u32 { - todo!() + unimplemented!() } fn sum(&self, _row_ids: &[u32]) -> Option { - todo!() + unimplemented!() } fn min(&self, _row_ids: &[u32]) -> Option { - todo!() + unimplemented!() } fn max(&self, _row_ids: &[u32]) -> Option { - todo!() + unimplemented!() } } diff --git a/read_buffer/src/column/encoding/string/dictionary.rs b/read_buffer/src/column/encoding/string/dictionary.rs index 88abc94167..d39d774f25 100644 --- a/read_buffer/src/column/encoding/string/dictionary.rs +++ b/read_buffer/src/column/encoding/string/dictionary.rs @@ -631,20 +631,20 @@ impl Dictionary { /// ids. NULL values are not considered the minimum value if any non-null /// value exists at any of the provided row ids. pub fn min<'a>(&'a self, _row_ids: &[u32]) -> Option<&'a String> { - todo!() + unimplemented!() } /// Returns the lexicographical maximum value for the provided set of row /// ids. NULL values are not considered the maximum value if any non-null /// value exists at any of the provided row ids. pub fn max<'a>(&'a self, _row_ids: &[u32]) -> Option<&'a String> { - todo!() + unimplemented!() } /// Returns the total number of non-null values found at the provided set of /// row ids. pub fn count(&self, _row_ids: &[u32]) -> u32 { - todo!() + unimplemented!() } /// Returns references to the logical (decoded) values for all the rows in @@ -788,7 +788,7 @@ impl Dictionary { // Returns true if there exists an encoded non-null value at any of the row // ids. fn find_non_null_value(&self, _row_ids: &[u32]) -> bool { - todo!() + unimplemented!() } } diff --git a/read_buffer/src/row_group.rs b/read_buffer/src/row_group.rs index 2776f4a380..f49210bddc 100644 --- a/read_buffer/src/row_group.rs +++ b/read_buffer/src/row_group.rs @@ -1031,7 +1031,7 @@ impl RowGroup { _group_column: ColumnName<'_>, _aggregates: &[(ColumnName<'_>, AggregateType)], ) { - todo!() + unimplemented!() } // Applies aggregates on multiple columns with an optional predicate. diff --git a/read_buffer/src/table.rs b/read_buffer/src/table.rs index 64740a8d68..4d1bbbefc8 100644 --- a/read_buffer/src/table.rs +++ b/read_buffer/src/table.rs @@ -412,7 +412,7 @@ impl Table { // identify segments where time range and predicates match could match // using segment meta data, and then execute against those segments and // merge results. - todo!() + unimplemented!() } // @@ -442,7 +442,7 @@ impl Table { // // Tied values (multiple equivalent min timestamps) results in an // arbitrary value from the result set being returned. - todo!(); + unimplemented!(); } /// The inverse of `first`. Of note here is that the returned value must @@ -458,7 +458,7 @@ impl Table { // // Tied values (multiple equivalent min timestamps) results in an // arbitrary value from the result set being returned. - todo!(); + unimplemented!(); } //