Skip to content

Commit 831a476

Browse files
[Issue-1961]: Handle clippy::ignored_unit_patterns (tensorzero#2820)
* [Issue-1961]: Handle clippy::ignored_unit_patterns * Fix linter error * Fix merge from main
1 parent c09b8d3 commit 831a476

File tree

11 files changed

+17
-13
lines changed

11 files changed

+17
-13
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ allow_attributes = "deny"
7575
dbg_macro = "deny"
7676
expect_used = "deny"
7777
if_not_else = "deny"
78+
ignored_unit_patterns = "deny"
7879
manual_string_new = "deny"
7980
match_bool = "deny"
8081
needless_raw_string_hashes = "deny"

clients/python/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@ impl AsyncTensorZeroGateway {
15731573
pyo3_async_runtimes::tokio::future_into_py(this.py(), async move {
15741574
let res = client.delete_datapoint(dataset_name, datapoint_id).await;
15751575
Python::with_gil(|py| match res {
1576-
Ok(_) => Ok(()),
1576+
Ok(()) => Ok(()),
15771577
Err(e) => Err(convert_error(py, e)),
15781578
})
15791579
})

evaluations/src/evaluators/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ pub(crate) async fn evaluate_inference(
135135
})
136136
.await
137137
{
138+
#[expect(clippy::ignored_unit_patterns)]
138139
Ok(_) => {
139140
debug!(evaluator_name = %evaluator_name, "Feedback sent successfully");
140141
},

evaluations/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ async fn main() -> Result<()> {
2525
let result = run_evaluation(args, evaluation_run_id, &mut writer).await;
2626

2727
match &result {
28-
Ok(_) => info!(evaluation_run_id = %evaluation_run_id, "Evaluation completed successfully"),
28+
Ok(()) => {
29+
info!(evaluation_run_id = %evaluation_run_id, "Evaluation completed successfully");
30+
}
2931
Err(e) => {
3032
tracing::error!(evaluation_run_id = %evaluation_run_id, error = %e, "Evaluation failed");
3133
}

gateway/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,13 @@ pub async fn shutdown_signal() {
393393
let hangup = std::future::pending::<()>();
394394

395395
tokio::select! {
396-
_ = ctrl_c => {
396+
() = ctrl_c => {
397397
tracing::info!("Received Ctrl+C signal");
398398
}
399-
_ = terminate => {
399+
() = terminate => {
400400
tracing::info!("Received SIGTERM signal");
401401
}
402-
_ = hangup => {
402+
() = hangup => {
403403
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
404404
tracing::info!("Received SIGHUP signal");
405405
}

tensorzero-core/src/config_parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ tokio::task_local! {
5757
pub fn skip_credential_validation() -> bool {
5858
// tokio::task_local doesn't have an 'is_set' method, so we call 'try_with'
5959
// (which returns an `Err` if the task-local is not set)
60-
SKIP_CREDENTIAL_VALIDATION.try_with(|_| ()).is_ok()
60+
SKIP_CREDENTIAL_VALIDATION.try_with(|()| ()).is_ok()
6161
}
6262

6363
#[derive(Debug, Default, Serialize)]

tensorzero-core/src/endpoints/stored_inference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub async fn render_samples<T: StoredSample>(
4848
// Filter out examples where reresolve_input_for_fine_tuning failed.
4949
// If resolution_result is Ok, map Some(()) to Some(example).
5050
// If resolution_result is Err, .ok() yields None, so filter_map drops it.
51-
resolution_result.ok().map(|_| example)
51+
resolution_result.ok().map(|()| example)
5252
})
5353
.filter_map(|resolved_example| {
5454
// resolved_example is a StoredInference that was successfully processed by reresolve.

tensorzero-core/src/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ impl FunctionConfig {
387387
// If the parsed output fails validation, we log the error and set `parsed_output` to None
388388
let parsed_output = match parsed_output {
389389
Some(parsed_output) => match output_schema.validate(&parsed_output).await {
390-
Ok(_) => Some(parsed_output),
390+
Ok(()) => Some(parsed_output),
391391
Err(_) => None,
392392
},
393393
None => None,

tensorzero-core/src/howdy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub async fn howdy_loop(clickhouse: ClickHouseConnectionInfo) {
5757
let client = Client::new();
5858
let deployment_id = match get_deployment_id(&clickhouse).await {
5959
Ok(deployment_id) => deployment_id,
60-
Err(_) => {
60+
Err(()) => {
6161
return;
6262
}
6363
};

tensorzero-core/src/providers/openai/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ impl InferenceProvider for OpenAIProvider {
497497
get_batch_url(self.api_base.as_ref().unwrap_or(&OPENAI_DEFAULT_BASE_URL))?;
498498
request_url
499499
.path_segments_mut()
500-
.map_err(|_| {
500+
.map_err(|()| {
501501
Error::new(ErrorDetails::Inference {
502502
message: "Failed to get mutable path segments".to_string(),
503503
})

0 commit comments

Comments
 (0)