Skip to content

Commit a065bf8

Browse files
mihaibudiugz
authored andcommitted
Fix issues found by pre-commit
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
1 parent ae702b7 commit a065bf8

File tree

7 files changed

+13
-17
lines changed

7 files changed

+13
-17
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
- id: cargo-clippy
99
name: Clippy Automatic Fixes
1010
description: Run the Clippy linter on the package.
11-
entry: cargo clippy --fix
11+
entry: cargo clippy --fix --allow-dirty
1212
language: rust
1313
files: \.rs$
1414
pass_filenames: false

crates/adapterlib/src/format.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl InputBuffer for Vec<Box<dyn InputBuffer>> {
248248
// Index of first buffer that should be preserved
249249
let mut index = 0;
250250
for v in self.iter_mut() {
251-
if remaining <= 0 {
251+
if remaining == 0 {
252252
break;
253253
}
254254
let buf = v.take_some(remaining);
@@ -395,15 +395,11 @@ impl Parser for StreamingPreprocessedParser {
395395
let (pre_data, mut pre_errors) = self.preprocessor.process(data);
396396
self.stream_splitter.append(&pre_data);
397397
let mut parsed: Vec<Box<dyn InputBuffer>> = Vec::new();
398-
loop {
399-
if let Some(chunk) = self.stream_splitter.next(true) {
400-
let (parsed_data, mut parse_errors) = self.parser.parse(chunk, metadata.clone());
401-
pre_errors.append(&mut parse_errors);
402-
if let Some(data) = parsed_data {
403-
parsed.push(data);
404-
}
405-
} else {
406-
break;
398+
while let Some(chunk) = self.stream_splitter.next(true) {
399+
let (parsed_data, mut parse_errors) = self.parser.parse(chunk, metadata.clone());
400+
pre_errors.append(&mut parse_errors);
401+
if let Some(data) = parsed_data {
402+
parsed.push(data);
407403
}
408404
}
409405
if parsed.is_empty() {

crates/adapterlib/src/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ impl ValueType {
1818

1919
/// Connector-specific metrics exported via the Prometheus `/metrics` endpoint.
2020
///
21-
/// Connectors that have metrics beyond the standard [`InputEndpointMetrics`]
21+
/// Connectors that have metrics beyond the standard `InputEndpointMetrics`
2222
/// should implement this trait and register themselves via
23-
/// [`InputConsumer::set_custom_metrics`] during [`TransportInputEndpoint::open`].
23+
/// `InputConsumer::set_custom_metrics` during `TransportInputEndpoint::open`.
2424
pub trait ConnectorMetrics: Send + Sync {
2525
/// Return a list of `(name, help, value_type, value)` tuples.
2626
///

crates/adapters/src/controller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6195,7 +6195,7 @@ impl ControllerInner {
61956195

61966196
/// Update counters after receiving a new input batch.
61976197
///
6198-
/// See [ControllerStatus::input_batch].
6198+
/// See `ControllerStatus::input_batch`.
61996199
pub fn input_batch(&self, endpoint_id: Option<EndpointId>, amt: BufferSize) {
62006200
// We update the individual endpoint metrics, then the global metrics.
62016201
// The order is important because global metrics updates can unpark the

crates/adapters/src/integrated/postgres/output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ struct WorkerHandle {
550550
thread: Option<std::thread::JoinHandle<()>>,
551551
}
552552

553-
/// Coordinates N parallel [`PostgresWorker`]s, each on its own thread.
553+
/// Coordinates N parallel `PostgresWorker`s, each on its own thread.
554554
///
555555
/// Incoming batches are partitioned by key range so each worker handles
556556
/// a disjoint slice of the data.

crates/adapters/src/preprocess.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct DecryptionPreprocessorConfig {
5959
/// A preprocessor that decrypts each chunk of data using AES-256-GCM.
6060
///
6161
/// The transport delivers the entire encrypted blob in a single [Preprocessor::process]
62-
/// call (enforced by [WholeBlobSplitter]). The blob format is:
62+
/// call (enforced by [`SpongeSplitter`]). The blob format is:
6363
///
6464
/// ```text
6565
/// [ 12-byte nonce ][ ciphertext ][ 16-byte GCM authentication tag ]

python/tests/runtime/test_connector_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def output_connector_status() -> OutputConnectorStatus:
288288
assert len(input_status.parse_errors) == 100
289289
assert input_status.metrics.num_parse_errors == 500
290290
assert input_status.metrics.num_transport_errors == 0
291-
assert input_status.metrics.end_of_input == False
291+
assert not input_status.metrics.end_of_input
292292
assert input_status.fatal_error is None
293293
assert input_status.metrics.total_records == 500
294294

0 commit comments

Comments
 (0)