Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
bc175b63
Unverified
Commit
bc175b63
authored
Dec 03, 2025
by
Tobias Koppers
Committed by
GitHub
Dec 03, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: use match consistently in macro (#86767)
### What? Cleanup for consistency
parent
6ef90ef4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
26 deletions
+33
-26
storage.rs
turbopack/crates/turbo-tasks-backend/src/backend/storage.rs
+33
-26
No files found.
turbopack/crates/turbo-tasks-backend/src/backend/storage.rs
View file @
bc175b63
...
@@ -1055,22 +1055,25 @@ macro_rules! update {
...
@@ -1055,22 +1055,25 @@ macro_rules! update {
}
}
macro_rules!
update_count
{
macro_rules!
update_count
{
(
$task:ident
,
$key:ident
$input:tt
,
-
$update:expr
)
=>
{{
(
$task:ident
,
$key:ident
$input:tt
,
-
$update:expr
)
=>
{
let
update
=
$update
;
match
$update
{
let
mut
state_change
=
false
;
update
=>
{
$crate
::
backend
::
storage
::
update!
(
$task
,
$key
$input
,
|
old
:
Option
<
_
>
|
{
let
mut
state_change
=
false
;
#[allow(unused_comparisons,
reason
=
"type of update might be unsigned, where update < 0 is always false"
)]
$crate
::
backend
::
storage
::
update!
(
$task
,
$key
$input
,
|
old
:
Option
<
_
>
|
{
if
let
Some
(
old
)
=
old
{
#[allow(unused_comparisons,
reason
=
"type of update might be unsigned, where update < 0 is always false"
)]
let
new
=
old
-
update
;
if
let
Some
(
old
)
=
old
{
state_change
=
old
<=
0
&&
new
>
0
||
old
>
0
&&
new
<=
0
;
let
new
=
old
-
update
;
(
new
!=
0
)
.then_some
(
new
)
state_change
=
old
<=
0
&&
new
>
0
||
old
>
0
&&
new
<=
0
;
}
else
{
(
new
!=
0
)
.then_some
(
new
)
state_change
=
update
<
0
;
}
else
{
(
update
!=
0
)
.then_some
(
-
update
)
state_change
=
update
<
0
;
(
update
!=
0
)
.then_some
(
-
update
)
}
});
state_change
}
}
});
}
state_change
};
}};
(
$task:ident
,
$key:ident
$input:tt
,
$update:expr
)
=>
{
(
$task:ident
,
$key:ident
$input:tt
,
$update:expr
)
=>
{
match
$update
{
match
$update
{
update
=>
{
update
=>
{
...
@@ -1091,22 +1094,26 @@ macro_rules! update_count {
...
@@ -1091,22 +1094,26 @@ macro_rules! update_count {
};
};
(
$task:ident
,
$key:ident
,
-
$update:expr
)
=>
{
(
$task:ident
,
$key:ident
,
-
$update:expr
)
=>
{
$crate
::
backend
::
storage
::
update_count!
(
$task
,
$key
{},
-
$update
)
$crate
::
backend
::
storage
::
update_count!
(
$task
,
$key
{},
-
$update
)
};
(
$task:ident
,
$key:ident
,
$update:expr
)
=>
{
};
(
$task:ident
,
$key:ident
,
$update:expr
)
=>
{
$crate
::
backend
::
storage
::
update_count!
(
$task
,
$key
{},
$update
)
$crate
::
backend
::
storage
::
update_count!
(
$task
,
$key
{},
$update
)
};
};
}
}
macro_rules!
update_count_and_get
{
macro_rules!
update_count_and_get
{
(
$task:ident
,
$key:ident
$input:tt
,
-
$update:expr
)
=>
{{
(
$task:ident
,
$key:ident
$input:tt
,
-
$update:expr
)
=>
{
let
update
=
$update
;
match
$update
{
let
mut
new
=
0
;
update
=>
{
$crate
::
backend
::
storage
::
update!
(
$task
,
$key
$input
,
|
old
:
Option
<
_
>
|
{
let
mut
new
=
0
;
let
old
=
old
.unwrap_or
(
0
);
$crate
::
backend
::
storage
::
update!
(
$task
,
$key
$input
,
|
old
:
Option
<
_
>
|
{
new
=
old
-
update
;
let
old
=
old
.unwrap_or
(
0
);
(
new
!=
0
)
.then_some
(
new
)
new
=
old
-
update
;
});
(
new
!=
0
)
.then_some
(
new
)
new
});
}};
new
}
}
};
(
$task:ident
,
$key:ident
$input:tt
,
$update:expr
)
=>
{
(
$task:ident
,
$key:ident
$input:tt
,
$update:expr
)
=>
{
match
$update
{
match
$update
{
update
=>
{
update
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment