Skip to content

Commit dfafffa

Browse files
goffrieConvex, Inc.
authored andcommitted
Prepare to migrate to edition 2024 (#42320)
GitOrigin-RevId: 61fb1187dfaf07ae6811a66187c5154d1696c82a
1 parent e8e9a80 commit dfafffa

File tree

73 files changed

+239
-252
lines changed

Some content is hidden

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

73 files changed

+239
-252
lines changed

crates/application/src/application_function_runner/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ impl<RT: Runtime> ApplicationFunctionRunner<RT> {
18381838
tx: &mut Transaction<RT>,
18391839
mutation_identifier: &Option<SessionRequestIdentifier>,
18401840
) -> anyhow::Result<Option<Result<MutationReturn, MutationError>>> {
1841-
let Some(ref identifier) = mutation_identifier else {
1841+
let Some(identifier) = mutation_identifier else {
18421842
return Ok(None);
18431843
};
18441844
let mutation_status = SessionRequestModel::new(tx)
@@ -1870,7 +1870,7 @@ impl<RT: Runtime> ApplicationFunctionRunner<RT> {
18701870
mutation_identifier: &Option<SessionRequestIdentifier>,
18711871
outcome: &ValidatedUdfOutcome,
18721872
) -> anyhow::Result<()> {
1873-
let Some(ref identifier) = mutation_identifier else {
1873+
let Some(identifier) = mutation_identifier else {
18741874
return Ok(());
18751875
};
18761876
if let Ok(ref value) = outcome.result {

crates/application/src/cache/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl CacheEntry {
273273
fn size(&self) -> usize {
274274
mem::size_of::<Self>()
275275
+ match self {
276-
CacheEntry::Ready(ref result) => result.heap_size(),
276+
CacheEntry::Ready(result) => result.heap_size(),
277277
// This is an under count since there might be something in the receiver.
278278
// However, this is kind of hard to measure, and we expect this to
279279
// be the exception, not the rule.
@@ -603,7 +603,7 @@ impl<RT: Runtime> CacheManager<RT> {
603603
let FunctionOutcome::Query(mut query_outcome) = outcome else {
604604
anyhow::bail!("Received non-query outcome when executing a query")
605605
};
606-
if let Ok(ref json_packed_value) = &query_outcome.result {
606+
if let Ok(json_packed_value) = &query_outcome.result {
607607
let output: ConvexValue = json_packed_value.unpack();
608608
let table_mapping = tx.table_mapping().namespace(component.into());
609609
let virtual_system_mapping = tx.virtual_system_mapping();
@@ -892,7 +892,7 @@ impl Inner {
892892
// `original_ts` matching.
893893
fn remove_ready(&mut self, key: &StoredCacheKey, original_ts: Timestamp) {
894894
match self.cache.get(key) {
895-
Some(CacheEntry::Ready(ref result)) if result.original_ts == original_ts => {
895+
Some(CacheEntry::Ready(result)) if result.original_ts == original_ts => {
896896
let (actual_key, entry) = self.cache.pop_entry(key).unwrap();
897897
self.size -= actual_key.size() + entry.size();
898898
},
@@ -943,7 +943,7 @@ impl Inner {
943943
self.size += new_entry.size();
944944
*entry = new_entry;
945945
},
946-
Some(CacheEntry::Ready(ref mut existing_result)) => {
946+
Some(CacheEntry::Ready(existing_result)) => {
947947
if existing_result.original_ts < result.original_ts
948948
|| (existing_result.original_ts == result.original_ts
949949
&& existing_result.token.ts() < result.token.ts())

crates/application/src/function_log.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ impl HeapSize for UdfParams {
419419
impl UdfParams {
420420
pub fn is_err(&self) -> bool {
421421
match self {
422-
UdfParams::Function { ref error, .. } => error.is_some(),
423-
UdfParams::Http { ref result, .. } => result.is_err(),
422+
UdfParams::Function { error, .. } => error.is_some(),
423+
UdfParams::Http { result, .. } => result.is_err(),
424424
}
425425
}
426426

crates/application/src/redaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ pub mod tests {
308308
}
309309
let json = serde_json::from_slice(&body_bytes).unwrap();
310310
must_let!(let JsonValue::Object(map) = json);
311-
must_let!(let JsonValue::String(ref code) = map.get("code").unwrap());
311+
must_let!(let JsonValue::String(code) = map.get("code").unwrap());
312312
code.clone()
313313
}
314314
}

crates/application/src/snapshot_import/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ fn remove_empty_string_optional_entries(
15511551
if !optional_fields.contains(&identifier_field_name) {
15521552
return true;
15531553
}
1554-
let JsonValue::String(ref s) = value else {
1554+
let &mut JsonValue::String(ref s) = value else {
15551555
return true;
15561556
};
15571557
!s.is_empty()

crates/application/src/tests/scheduled_jobs.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use std::{
2-
str::FromStr,
3-
time::Duration,
4-
};
1+
use std::str::FromStr;
52

63
use common::{
74
components::{
@@ -11,6 +8,7 @@ use common::{
118
PublicFunctionPath,
129
},
1310
execution_context::ExecutionContext,
11+
knobs::SCHEDULED_JOB_RETENTION,
1412
pause::{
1513
HoldGuard,
1614
PauseController,
@@ -187,7 +185,6 @@ async fn test_scheduled_jobs_garbage_collection(
187185
rt: TestRuntime,
188186
pause_controller: PauseController,
189187
) -> anyhow::Result<()> {
190-
std::env::set_var("SCHEDULED_JOB_RETENTION", "30");
191188
let application = Application::new_for_tests(&rt).await?;
192189
application.load_udf_tests_modules().await?;
193190

@@ -216,7 +213,7 @@ async fn test_scheduled_jobs_garbage_collection(
216213
);
217214

218215
// Wait for garbage collector to clean up the job
219-
rt.wait(Duration::from_secs(60)).await;
216+
rt.wait(*SCHEDULED_JOB_RETENTION * 2).await;
220217
tx = application.begin(Identity::system()).await?;
221218
let state = SchedulerModel::new(&mut tx, TableNamespace::test_user())
222219
.check_status(job_id)

crates/authentication/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![feature(never_type)]
2+
13
use std::{
24
str::FromStr,
35
time::SystemTime,
@@ -771,7 +773,6 @@ where
771773
#[cfg(test)]
772774
mod tests {
773775
use std::{
774-
convert::Infallible,
775776
pin::Pin,
776777
time::SystemTime,
777778
};
@@ -834,8 +835,7 @@ mod tests {
834835
fn fake_http_client(
835836
metadata: String,
836837
jwks: String,
837-
) -> impl Fn(HttpRequest) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Infallible>>>>
838-
{
838+
) -> impl Fn(HttpRequest) -> Pin<Box<dyn Future<Output = Result<HttpResponse, !>>>> {
839839
move |request: HttpRequest| {
840840
let metadata_ = metadata.clone();
841841
let jwks_ = jwks.clone();
@@ -861,7 +861,7 @@ mod tests {
861861
fn fake_workos_http_client(
862862
client_id: &str,
863863
jwks: String,
864-
) -> impl Fn(HttpRequest) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Infallible>>>>
864+
) -> impl Fn(HttpRequest) -> Pin<Box<dyn Future<Output = Result<HttpResponse, !>>>> + use<>
865865
{
866866
let client_id = client_id.to_string();
867867
move |request: HttpRequest| {

crates/aws_s3/src/storage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ impl<RT: Runtime> Upload for S3Upload<RT> {
684684
}
685685

686686
impl<RT: Runtime> S3Upload<RT> {
687-
fn _abort(&mut self) -> impl Future<Output = anyhow::Result<()>> {
687+
fn _abort(&mut self) -> impl Future<Output = anyhow::Result<()>> + use<RT> {
688688
let client = self.client.clone();
689689
let bucket = self.bucket.clone();
690690
let upload_id = self.upload_id.to_string();

crates/aws_utils/src/s3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl S3Client {
5757
&self,
5858
bucket: String,
5959
delimiter: String,
60-
) -> impl Stream<Item = anyhow::Result<String>> + Send + Unpin {
60+
) -> impl Stream<Item = anyhow::Result<String>> + Send + Unpin + use<> {
6161
let stream = self
6262
.0
6363
.list_objects_v2()
@@ -82,7 +82,7 @@ impl S3Client {
8282
&self,
8383
bucket: String,
8484
prefix: Option<String>,
85-
) -> impl Stream<Item = anyhow::Result<Object>> + Send + Unpin {
85+
) -> impl Stream<Item = anyhow::Result<Object>> + Send + Unpin + use<> {
8686
let stream = self
8787
.0
8888
.list_objects_v2()

crates/common/src/fastrace_helpers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ impl<T: Future> Future for TraceIfPending<T> {
299299
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
300300
let this = self.project();
301301
let _guard;
302-
if let TraceIfPendingState::Tracing(ref span) = this.state {
302+
if let &mut TraceIfPendingState::Tracing(ref span) = this.state {
303303
_guard = span.set_local_parent();
304304
}
305305
let result = this.future.poll(cx);

0 commit comments

Comments
 (0)