Skip to content

Commit d49eaad

Browse files
[Issue-1961] Handle clippy::semicolon_if_nothing_returned (tensorzero#2814)
* [Issue-1961] Handle clippy::semicolon_if_nothing_returned * Remove cfg of e2e test field
1 parent bd55a41 commit d49eaad

File tree

30 files changed

+64
-63
lines changed

30 files changed

+64
-63
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ panic = "deny"
8282
print_stderr = "deny"
8383
print_stdout = "deny"
8484
redundant_closure_for_method_calls = "deny"
85+
semicolon-if-nothing-returned = "deny"
8586
todo = "deny"
8687
trivially_copy_pass_by_ref = "deny"
8788
unimplemented = "deny"

clients/rust/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ impl Client {
11851185
ClientMode::HTTPGateway(client) => {
11861186
// Acquire the lock on the gateway version
11871187
let mut gateway_version = client.gateway_version.lock().await;
1188-
*gateway_version = Some(version)
1188+
*gateway_version = Some(version);
11891189
}
11901190
// Should never be called
11911191
ClientMode::EmbeddedGateway { .. } => {}

evaluations/src/evaluators/llm_judge/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ fn prepare_messages_input(input: &ClientInput) -> Result<Vec<ClientInputMessage>
297297
content: vec![ClientInputMessageContent::Text(TextKind::Text {
298298
text: system_message,
299299
})],
300-
})
300+
});
301301
}
302302
_ => {
303303
bail!("System message is not a string or object");

evaluations/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async fn main() -> Result<()> {
2727
match &result {
2828
Ok(_) => info!(evaluation_run_id = %evaluation_run_id, "Evaluation completed successfully"),
2929
Err(e) => {
30-
tracing::error!(evaluation_run_id = %evaluation_run_id, error = %e, "Evaluation failed")
30+
tracing::error!(evaluation_run_id = %evaluation_run_id, error = %e, "Evaluation failed");
3131
}
3232
}
3333

evaluations/src/stats.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl EvaluationStats {
5454
}
5555
match evaluation_update {
5656
EvaluationUpdate::Success(evaluation_info) => {
57-
self.evaluation_infos.push(evaluation_info)
57+
self.evaluation_infos.push(evaluation_info);
5858
}
5959
EvaluationUpdate::Error(evaluation_error) => {
6060
self.evaluation_errors.push(evaluation_error);

evaluations/tests/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ async fn run_evaluations_best_of_3() {
17341734
assert!(model_inference["system"]
17351735
.as_str()
17361736
.unwrap()
1737-
.starts_with("You are an assistant tasked with re-ranking"))
1737+
.starts_with("You are an assistant tasked with re-ranking"));
17381738
}
17391739
}
17401740
assert_eq!(happy_count, 3);
@@ -1922,7 +1922,7 @@ async fn run_evaluations_mixture_of_3() {
19221922
assert!(model_inference["system"]
19231923
.as_str()
19241924
.unwrap()
1925-
.starts_with("You have been provided with a set of responses from various"))
1925+
.starts_with("You have been provided with a set of responses from various"));
19261926
}
19271927
}
19281928
assert_eq!(happy_count, 3);

internal/tensorzero-derive/tests/deserialize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fn test_good_deserialize() {
3333
},
3434
field2: true,
3535
}
36-
)
36+
);
3737
}
3838

3939
#[test]

tensorzero-core/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ fn main() {
88
if std::env::var("TENSORZERO_SKIP_BUILD_INFO").is_ok() {
99
println!("cargo:rerun-if-env-changed=TENSORZERO_SKIP_BUILD_INFO");
1010
}
11-
built::write_built_file().expect("Failed to acquire build-time information")
11+
built::write_built_file().expect("Failed to acquire build-time information");
1212
}

tensorzero-core/src/config_parser/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ impl ObjectStoreInfo {
237237
}
238238
if let Some(allow_http) = *allow_http {
239239
if allow_http {
240-
tracing::warn!("`[object_storage.allow_http]` is set to `true` - this is insecure, and should only be used when running a local S3-compatible object store")
240+
tracing::warn!("`[object_storage.allow_http]` is set to `true` - this is insecure, and should only be used when running a local S3-compatible object store");
241241
}
242242
builder = builder.with_allow_http(allow_http);
243243
}
@@ -454,7 +454,7 @@ impl Config {
454454

455455
async fn load_from_toml(table: toml::Table, base_path: PathBuf) -> Result<Config, Error> {
456456
if table.is_empty() {
457-
tracing::info!("Config file is empty, so only default functions will be available.")
457+
tracing::info!("Config file is empty, so only default functions will be available.");
458458
}
459459
let uninitialized_config = UninitializedConfig::try_from(table)?;
460460

tensorzero-core/src/config_parser/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@ async fn test_empty_config() {
15211521
.unwrap();
15221522
assert!(logs_contain(
15231523
"Config file is empty, so only default functions will be available."
1524-
))
1524+
));
15251525
}
15261526

15271527
#[tokio::test]

0 commit comments

Comments
 (0)