Skip to content

Commit 7118f55

Browse files
committed
codemod(turbopack): Remove unused async function modifier keywords
1 parent 94c4e5d commit 7118f55

File tree

98 files changed

+238
-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.

98 files changed

+238
-252
lines changed

crates/next-api/src/app.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl AppProject {
152152
}
153153

154154
#[turbo_tasks::function]
155-
async fn client_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
155+
fn client_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
156156
Ok(get_client_module_options_context(
157157
self.project().project_path(),
158158
self.project().execution_context(),
@@ -164,7 +164,7 @@ impl AppProject {
164164
}
165165

166166
#[turbo_tasks::function]
167-
async fn client_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
167+
fn client_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
168168
Ok(get_client_resolve_options_context(
169169
self.project().project_path(),
170170
Value::new(self.client_ty()),
@@ -180,13 +180,13 @@ impl AppProject {
180180
}
181181

182182
#[turbo_tasks::function]
183-
async fn client_transition(self: Vc<Self>) -> Result<Vc<FullContextTransition>> {
183+
fn client_transition(self: Vc<Self>) -> Result<Vc<FullContextTransition>> {
184184
let module_context = self.client_module_context();
185185
Ok(FullContextTransition::new(module_context))
186186
}
187187

188188
#[turbo_tasks::function]
189-
async fn rsc_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
189+
fn rsc_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
190190
Ok(get_server_module_options_context(
191191
self.project().project_path(),
192192
self.project().execution_context(),
@@ -198,7 +198,7 @@ impl AppProject {
198198
}
199199

200200
#[turbo_tasks::function]
201-
async fn edge_rsc_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
201+
fn edge_rsc_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
202202
Ok(get_server_module_options_context(
203203
self.project().project_path(),
204204
self.project().execution_context(),
@@ -210,7 +210,7 @@ impl AppProject {
210210
}
211211

212212
#[turbo_tasks::function]
213-
async fn route_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
213+
fn route_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
214214
Ok(get_server_module_options_context(
215215
self.project().project_path(),
216216
self.project().execution_context(),
@@ -222,7 +222,7 @@ impl AppProject {
222222
}
223223

224224
#[turbo_tasks::function]
225-
async fn edge_route_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
225+
fn edge_route_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
226226
Ok(get_server_module_options_context(
227227
self.project().project_path(),
228228
self.project().execution_context(),
@@ -234,7 +234,7 @@ impl AppProject {
234234
}
235235

236236
#[turbo_tasks::function]
237-
async fn rsc_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
237+
fn rsc_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
238238
Ok(get_server_resolve_options_context(
239239
self.project().project_path(),
240240
Value::new(self.rsc_ty()),
@@ -245,7 +245,7 @@ impl AppProject {
245245
}
246246

247247
#[turbo_tasks::function]
248-
async fn edge_rsc_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
248+
fn edge_rsc_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
249249
Ok(get_edge_resolve_options_context(
250250
self.project().project_path(),
251251
Value::new(self.rsc_ty()),
@@ -256,7 +256,7 @@ impl AppProject {
256256
}
257257

258258
#[turbo_tasks::function]
259-
async fn route_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
259+
fn route_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
260260
Ok(get_server_resolve_options_context(
261261
self.project().project_path(),
262262
Value::new(self.route_ty()),
@@ -267,9 +267,7 @@ impl AppProject {
267267
}
268268

269269
#[turbo_tasks::function]
270-
async fn edge_route_resolve_options_context(
271-
self: Vc<Self>,
272-
) -> Result<Vc<ResolveOptionsContext>> {
270+
fn edge_route_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
273271
Ok(get_edge_resolve_options_context(
274272
self.project().project_path(),
275273
Value::new(self.route_ty()),
@@ -446,7 +444,7 @@ impl AppProject {
446444
}
447445

448446
#[turbo_tasks::function]
449-
async fn ssr_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
447+
fn ssr_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
450448
Ok(get_server_module_options_context(
451449
self.project().project_path(),
452450
self.project().execution_context(),
@@ -458,7 +456,7 @@ impl AppProject {
458456
}
459457

460458
#[turbo_tasks::function]
461-
async fn edge_ssr_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
459+
fn edge_ssr_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
462460
Ok(get_server_module_options_context(
463461
self.project().project_path(),
464462
self.project().execution_context(),
@@ -470,7 +468,7 @@ impl AppProject {
470468
}
471469

472470
#[turbo_tasks::function]
473-
async fn ssr_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
471+
fn ssr_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
474472
Ok(get_server_resolve_options_context(
475473
self.project().project_path(),
476474
Value::new(self.ssr_ty()),
@@ -481,7 +479,7 @@ impl AppProject {
481479
}
482480

483481
#[turbo_tasks::function]
484-
async fn edge_ssr_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
482+
fn edge_ssr_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
485483
Ok(get_edge_resolve_options_context(
486484
self.project().project_path(),
487485
Value::new(self.ssr_ty()),
@@ -532,7 +530,7 @@ impl AppProject {
532530
}
533531

534532
#[turbo_tasks::function]
535-
async fn runtime_entries(self: Vc<Self>) -> Result<Vc<RuntimeEntries>> {
533+
fn runtime_entries(self: Vc<Self>) -> Result<Vc<RuntimeEntries>> {
536534
Ok(get_server_runtime_entries(
537535
Value::new(self.rsc_ty()),
538536
self.project().next_mode(),
@@ -560,7 +558,7 @@ impl AppProject {
560558
}
561559

562560
#[turbo_tasks::function]
563-
async fn client_runtime_entries(self: Vc<Self>) -> Result<Vc<EvaluatableAssets>> {
561+
fn client_runtime_entries(self: Vc<Self>) -> Result<Vc<EvaluatableAssets>> {
564562
Ok(get_client_runtime_entries(
565563
self.project().project_path(),
566564
Value::new(self.client_ty()),

crates/next-api/src/global_module_id_strategy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl GlobalModuleIdStrategyBuilder {
8484
// NOTE(LichuAcu) We can't move this function to `turbopack-core` because we need access to
8585
// `Endpoint`, which is not available there.
8686
#[turbo_tasks::function]
87-
async fn preprocess_module_ids(
87+
fn preprocess_module_ids(
8888
endpoint: Vc<Box<dyn Endpoint>>,
8989
) -> Result<Vc<PreprocessedChildrenIdents>> {
9090
let root_modules = endpoint.root_modules();

crates/next-api/src/instrumentation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl InstrumentationEndpoint {
6565
}
6666

6767
#[turbo_tasks::function]
68-
async fn core_modules(&self) -> Result<Vc<InstrumentationCoreModules>> {
68+
fn core_modules(&self) -> Result<Vc<InstrumentationCoreModules>> {
6969
let userland_module = self
7070
.asset_context
7171
.process(

crates/next-api/src/middleware.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ impl MiddlewareEndpoint {
255255
}
256256

257257
#[turbo_tasks::function]
258-
async fn userland_module(&self) -> Result<Vc<Box<dyn Module>>> {
258+
fn userland_module(&self) -> Result<Vc<Box<dyn Module>>> {
259259
Ok(self
260260
.asset_context
261261
.process(

crates/next-api/src/pages.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub struct PagesProject {
8181
#[turbo_tasks::value_impl]
8282
impl PagesProject {
8383
#[turbo_tasks::function]
84-
pub async fn new(project: Vc<Project>) -> Result<Vc<Self>> {
84+
pub fn new(project: Vc<Project>) -> Result<Vc<Self>> {
8585
Ok(PagesProject { project }.cell())
8686
}
8787

@@ -279,7 +279,7 @@ impl PagesProject {
279279
}
280280

281281
#[turbo_tasks::function]
282-
async fn client_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
282+
fn client_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
283283
Ok(get_client_module_options_context(
284284
self.project().project_path(),
285285
self.project().execution_context(),
@@ -293,7 +293,7 @@ impl PagesProject {
293293
}
294294

295295
#[turbo_tasks::function]
296-
async fn client_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
296+
fn client_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
297297
Ok(get_client_resolve_options_context(
298298
self.project().project_path(),
299299
Value::new(ClientContextType::Pages {
@@ -385,7 +385,7 @@ impl PagesProject {
385385
}
386386

387387
#[turbo_tasks::function]
388-
async fn ssr_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
388+
fn ssr_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
389389
Ok(get_server_module_options_context(
390390
self.project().project_path(),
391391
self.project().execution_context(),
@@ -399,7 +399,7 @@ impl PagesProject {
399399
}
400400

401401
#[turbo_tasks::function]
402-
async fn edge_ssr_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
402+
fn edge_ssr_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
403403
Ok(get_server_module_options_context(
404404
self.project().project_path(),
405405
self.project().execution_context(),
@@ -413,7 +413,7 @@ impl PagesProject {
413413
}
414414

415415
#[turbo_tasks::function]
416-
async fn api_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
416+
fn api_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
417417
Ok(get_server_module_options_context(
418418
self.project().project_path(),
419419
self.project().execution_context(),
@@ -427,7 +427,7 @@ impl PagesProject {
427427
}
428428

429429
#[turbo_tasks::function]
430-
async fn edge_api_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
430+
fn edge_api_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
431431
Ok(get_server_module_options_context(
432432
self.project().project_path(),
433433
self.project().execution_context(),
@@ -441,7 +441,7 @@ impl PagesProject {
441441
}
442442

443443
#[turbo_tasks::function]
444-
async fn ssr_data_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
444+
fn ssr_data_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
445445
Ok(get_server_module_options_context(
446446
self.project().project_path(),
447447
self.project().execution_context(),
@@ -455,9 +455,7 @@ impl PagesProject {
455455
}
456456

457457
#[turbo_tasks::function]
458-
async fn edge_ssr_data_module_options_context(
459-
self: Vc<Self>,
460-
) -> Result<Vc<ModuleOptionsContext>> {
458+
fn edge_ssr_data_module_options_context(self: Vc<Self>) -> Result<Vc<ModuleOptionsContext>> {
461459
Ok(get_server_module_options_context(
462460
self.project().project_path(),
463461
self.project().execution_context(),
@@ -471,7 +469,7 @@ impl PagesProject {
471469
}
472470

473471
#[turbo_tasks::function]
474-
async fn ssr_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
472+
fn ssr_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
475473
Ok(get_server_resolve_options_context(
476474
self.project().project_path(),
477475
// NOTE(alexkirsz) This could be `PagesData` for the data endpoint, but it doesn't
@@ -487,7 +485,7 @@ impl PagesProject {
487485
}
488486

489487
#[turbo_tasks::function]
490-
async fn edge_ssr_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
488+
fn edge_ssr_resolve_options_context(self: Vc<Self>) -> Result<Vc<ResolveOptionsContext>> {
491489
Ok(get_edge_resolve_options_context(
492490
self.project().project_path(),
493491
// NOTE(alexkirsz) This could be `PagesData` for the data endpoint, but it doesn't
@@ -503,7 +501,7 @@ impl PagesProject {
503501
}
504502

505503
#[turbo_tasks::function]
506-
async fn client_runtime_entries(self: Vc<Self>) -> Result<Vc<EvaluatableAssets>> {
504+
fn client_runtime_entries(self: Vc<Self>) -> Result<Vc<EvaluatableAssets>> {
507505
let client_runtime_entries = get_client_runtime_entries(
508506
self.project().project_path(),
509507
Value::new(ClientContextType::Pages {
@@ -517,7 +515,7 @@ impl PagesProject {
517515
}
518516

519517
#[turbo_tasks::function]
520-
async fn runtime_entries(self: Vc<Self>) -> Result<Vc<RuntimeEntries>> {
518+
fn runtime_entries(self: Vc<Self>) -> Result<Vc<RuntimeEntries>> {
521519
Ok(get_server_runtime_entries(
522520
Value::new(ServerContextType::Pages {
523521
pages_dir: self.pages_dir(),
@@ -527,7 +525,7 @@ impl PagesProject {
527525
}
528526

529527
#[turbo_tasks::function]
530-
async fn data_runtime_entries(self: Vc<Self>) -> Result<Vc<RuntimeEntries>> {
528+
fn data_runtime_entries(self: Vc<Self>) -> Result<Vc<RuntimeEntries>> {
531529
Ok(get_server_runtime_entries(
532530
Value::new(ServerContextType::PagesData {
533531
pages_dir: self.pages_dir(),
@@ -640,7 +638,7 @@ impl PageEndpoint {
640638
}
641639

642640
#[turbo_tasks::function]
643-
async fn source(&self) -> Result<Vc<Box<dyn Source>>> {
641+
fn source(&self) -> Result<Vc<Box<dyn Source>>> {
644642
Ok(Vc::upcast(FileSource::new(self.page.project_path())))
645643
}
646644

0 commit comments

Comments
 (0)