Skip to content

Commit 3293398

Browse files
authored
chore: update rust to 1.88.0 (#5504)
1. Update stable Rust to 1.88.0 and fix a new clippy lint enforcing variables to be written inline in format strings. 2. Update nightly Rust for query-engine-wasm to latest and fix a new stylistic compiler warning suggesting for elided lifetimes in paths to be written explicitly when the lifetime flows from the function argument to its return type.
1 parent 3aa73ce commit 3293398

74 files changed

Lines changed: 126 additions & 142 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

libs/driver-adapters/src/conversion/js_arg_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl core::fmt::Display for JSArgType {
6565
JSArgType::Time => "Time",
6666
};
6767

68-
write!(f, "{}", s)
68+
write!(f, "{s}")
6969
}
7070
}
7171

libs/driver-adapters/src/queryable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl QuaintQueryable for JsBaseQueryable {
149149
AdapterProvider::SqlServer => visitor::Mssql::version_expr(),
150150
};
151151

152-
let query = format!(r#"SELECT {} AS version"#, version_expr);
152+
let query = format!(r#"SELECT {version_expr} AS version"#);
153153
let rows = self.query_raw(query.as_str(), &[]).await?;
154154

155155
let version_string = rows
@@ -187,7 +187,7 @@ impl QuaintQueryable for JsBaseQueryable {
187187

188188
impl JsBaseQueryable {
189189
pub fn phantom_query_message(stmt: &str) -> String {
190-
format!(r#"-- Implicit "{}" query via underlying driver"#, stmt)
190+
format!(r#"-- Implicit "{stmt}" query via underlying driver"#)
191191
}
192192

193193
async fn do_query_raw_inner(&self, sql: &str, params: &[quaint::Value<'_>]) -> quaint::Result<ResultSet> {

libs/telemetry/src/id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use derive_more::Display;
88
use serde::{Deserialize, Serialize};
99

1010
#[derive(Debug, Display, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
11-
#[display(fmt = "{}", _0)]
11+
#[display(fmt = "{_0}")]
1212
#[repr(transparent)]
1313
struct SerializableNonZeroU64(NonZeroU64);
1414

libs/telemetry/src/layer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl<Filter: AllowAttribute> field::Visit for SpanAttributeVisitor<'_, Filter> {
228228

229229
fn record_debug(&mut self, field: &field::Field, value: &dyn std::fmt::Debug) {
230230
if Filter::allow_on_span(field.name()) {
231-
self.record_str(field, &format!("{:?}", value))
231+
self.record_str(field, &format!("{value:?}"))
232232
}
233233
}
234234
}
@@ -285,7 +285,7 @@ impl<Filter: AllowAttribute> field::Visit for EventAttributeVisitor<'_, Filter>
285285

286286
fn record_debug(&mut self, field: &field::Field, value: &dyn std::fmt::Debug) {
287287
if Filter::allow_on_event(field.name()) {
288-
self.record_str(field, &format!("{:?}", value))
288+
self.record_str(field, &format!("{value:?}"))
289289
}
290290
}
291291
}

prisma-fmt/src/code_actions/field.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub(super) fn add_missing_opposite_relation(
5656
.find(|attr| attr.name() == "relation")
5757
.and_then(|attr| attr.arguments.arguments.iter().find(|arg| arg.value.is_string()));
5858

59-
let relation = name_arg.map_or(Default::default(), |arg| format!(" @relation({})", arg));
59+
let relation = name_arg.map_or(Default::default(), |arg| format!(" @relation({arg})"));
6060

6161
let formatted_content = format!("{separator}{indentation}{name} {name}[]{relation}{newline}");
6262

@@ -71,7 +71,7 @@ pub(super) fn add_missing_opposite_relation(
7171
};
7272

7373
let action = CodeAction {
74-
title: format!("Add missing relation field to model {}", target_name),
74+
title: format!("Add missing relation field to model {target_name}"),
7575
kind: Some(CodeActionKind::QUICKFIX),
7676
edit: Some(edit),
7777
diagnostics: Some(diagnostics),

prisma-fmt/src/code_actions/relations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ pub(super) fn add_referencing_side_relation(
304304
.find(|arg| arg.value.is_string())
305305
.map_or(Default::default(), |arg| format!("{arg}, "));
306306

307-
let new_text = format!("@relation({}{}, {})", name, fields_arg, references);
307+
let new_text = format!("@relation({name}{fields_arg}, {references})");
308308
let range = super::span_to_range(attr.span(), ctx.initiating_file_source());
309309

310310
(range, new_text)

prisma-fmt/src/references.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn reference_locations_for_target(ctx: ReferencesContext<'_>, target: SchemaPosi
135135
let referenced_model = field.field_type.name();
136136

137137
let Some(ref_model_id) = ctx.db.find_model(referenced_model) else {
138-
warn!("Could not find model with name: {}", referenced_model);
138+
warn!("Could not find model with name: {referenced_model}");
139139
return empty_references();
140140
};
141141

psl/parser-database/src/attributes/default.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ fn format_valid_values<const N: usize>(valid_values: &[u8; N]) -> String {
398398

399399
let (last, rest) = valid_values.split_last().unwrap();
400400
let rest_str = rest.iter().map(|v| v.to_string()).join(", ");
401-
format!("{}, or {}", rest_str, last)
401+
format!("{rest_str}, or {last}")
402402
}
403403
}
404404
}

psl/psl/tests/common/asserts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ impl ScalarFieldAssert for walkers::ScalarFieldWalker<'_> {
355355

356356
let nt = match connector.parse_native_type(r#type, params, span, &mut diagnostics) {
357357
Some(nt) => nt,
358-
None => panic!("Invalid native type {}", r#type),
358+
None => panic!("Invalid native type {type}"),
359359
};
360360

361361
diagnostics.to_result().unwrap();

quaint/quaint-test-macros/src/test_each_connector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn test_each_connector_async_wrapper_functions(
120120
for connector in args.connectors_to_test() {
121121
let connector_name = connector.name();
122122
let feature_name = connector.feature_name();
123-
let connector_test_fn_name = Ident::new(&format!("{}_on_{}", test_fn_name, connector_name), Span::call_site());
123+
let connector_test_fn_name = Ident::new(&format!("{test_fn_name}_on_{connector_name}"), Span::call_site());
124124

125125
let conn_api_factory = Ident::new(connector.test_api(), Span::call_site());
126126

0 commit comments

Comments
 (0)