Skip to content

Commit 20349ee

Browse files
authored
Merge branch 'main' into main
2 parents d002854 + 4cef7c6 commit 20349ee

File tree

32 files changed

+60
-49
lines changed

32 files changed

+60
-49
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ unsafe_code = "forbid"
7474
allow_attributes = "deny"
7575
dbg_macro = "deny"
7676
expect_used = "deny"
77+
explicit_iter_loop = "deny"
7778
if_not_else = "deny"
7879
ignored_unit_patterns = "deny"
7980
manual_string_new = "deny"
@@ -88,6 +89,7 @@ todo = "deny"
8889
trivially_copy_pass_by_ref = "deny"
8990
unimplemented = "deny"
9091
uninlined_format_args = "deny"
92+
unnecessary_wraps = "deny"
9193
unreachable = "deny"
9294
unused_self = "deny"
9395
unwrap_used = "deny"

clients/python/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ impl TensorZeroGateway {
587587
}
588588

589589
// TODO - implement closing the 'reqwest' connection pool: https://github.com/tensorzero/tensorzero/issues/857
590+
#[expect(clippy::unnecessary_wraps)]
590591
fn __exit__(
591592
_this: Py<Self>,
592593
_exc_type: Py<PyAny>,

evaluations/src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub async fn get_tool_params_args(
2727
FunctionConfig::Chat(function_config) => {
2828
let mut additional_tools = Vec::new();
2929
let mut allowed_tools = Vec::new();
30-
for tool in tool_params.tools_available.iter() {
30+
for tool in &tool_params.tools_available {
3131
if function_config.tools.contains(&tool.name) {
3232
allowed_tools.push(tool.name.clone());
3333
} else {

evaluations/src/stats.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ impl EvaluationStats {
7777
debug!(evaluators = ?evaluators.keys().collect::<Vec<_>>(), "Initialized data collectors for evaluators");
7878
// Collect evaluation inference data into vectors by evaluation (all as floats)
7979
debug!("Processing evaluation results into statistics");
80-
for evaluation_info in self.evaluation_infos.iter() {
81-
for (evaluation_name, evaluation_result) in evaluation_info.evaluations.iter() {
80+
for evaluation_info in &self.evaluation_infos {
81+
for (evaluation_name, evaluation_result) in &evaluation_info.evaluations {
8282
match evaluation_result {
8383
Some(Value::Number(n)) => {
8484
if let Some(data_vec) = data.get_mut(evaluation_name) {

examples/integrations/cursor/feedback/src/ted/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<'tree, L: Eq> Tree<'tree, L> {
202202
) -> Self {
203203
let key_roots = Self::compute_key_roots(left_most_leaf_descendant_root, parent_offset);
204204
debug_assert!(!key_roots.is_empty(), "key_roots must have ≥1 node");
205-
for root in key_roots.iter() {
205+
for root in &key_roots {
206206
debug_assert!(*root < post.len(), "key_root must be within bounds");
207207
}
208208
debug_assert_eq!(

internal/tensorzero-derive/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ pub fn tensorzero_derive(input: TokenStream) -> TokenStream {
119119
// other derive macros (e.g. `#[strum]`0. We're not applying any derive macros
120120
// to our new enum, so we need to avoid copying over other attributes to prevent errors.
121121
let mut stripped_variants = data.variants.clone();
122-
for variant in stripped_variants.iter_mut() {
122+
for variant in &mut stripped_variants {
123123
variant.attrs.retain(|attr| attr.path().is_ident("serde"));
124-
for field in variant.fields.iter_mut() {
124+
for field in &mut variant.fields {
125125
field.attrs.retain(|attr| attr.path().is_ident("serde"));
126126
}
127127
}

tensorzero-core/src/clickhouse/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ fn set_clickhouse_format_settings(database_url: &mut Url) {
659659
}
660660
}
661661

662-
for setting in OVERRIDDEN_SETTINGS.iter() {
662+
for setting in &OVERRIDDEN_SETTINGS {
663663
database_url.query_pairs_mut().append_pair(setting, "0");
664664
}
665665
database_url.query_pairs_mut().finish();

tensorzero-core/src/config_parser/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ impl UninitializedFunctionConfig {
977977
.into_iter()
978978
.map(|(name, variant)| variant.load().map(|v| (name, Arc::new(v))))
979979
.collect::<Result<HashMap<_, _>, Error>>()?;
980-
for (name, variant) in variants.iter() {
980+
for (name, variant) in &variants {
981981
if let VariantConfig::ChatCompletion(chat_config) = &variant.inner {
982982
if chat_config.json_mode.is_some() {
983983
return Err(ErrorDetails::Config {
@@ -1025,7 +1025,7 @@ impl UninitializedFunctionConfig {
10251025
.map(|(name, variant)| variant.load().map(|v| (name, Arc::new(v))))
10261026
.collect::<Result<HashMap<_, _>, Error>>()?;
10271027

1028-
for (name, variant) in variants.iter() {
1028+
for (name, variant) in &variants {
10291029
let mut warn_variant = None;
10301030
match &variant.inner {
10311031
VariantConfig::ChatCompletion(chat_config) => {

tensorzero-core/src/endpoints/dynamic_evaluation_run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub fn validate_variant_pins(
141141
variant_pins: &HashMap<String, String>,
142142
config: &Config,
143143
) -> Result<(), Error> {
144-
for (function_name, variant_name) in variant_pins.iter() {
144+
for (function_name, variant_name) in variant_pins {
145145
let function_config = config.get_function(function_name)?;
146146
function_config
147147
.variants()

tensorzero-core/src/evaluations/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ impl UninitializedLLMJudgeVariantInfo {
776776
/// We want to make sure that there is an UninitializedLLMJudgeVariantConfig for each VariantConfig.
777777
/// This function should complain at compile time if we forget to update it when adding a new variant type.
778778
#[expect(dead_code)]
779+
#[expect(clippy::unnecessary_wraps)]
779780
fn check_convert_variant_to_llm_judge_variant(
780781
variant: VariantConfig,
781782
) -> Result<UninitializedLLMJudgeVariantConfig, Error> {

0 commit comments

Comments
 (0)