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
e5326844
Unverified
Commit
e5326844
authored
Aug 07, 2025
by
Niklas Mischkulnig
Committed by
GitHub
Aug 07, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: remove a few clones (#82435)
Showed up in an ast-grep search for `&$$$.clone()`
parent
4dd7c7fa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
react_compiler.rs
crates/napi/src/react_compiler.rs
+1
-1
mod.rs
turbopack/crates/turbopack-core/src/resolve/mod.rs
+2
-2
pattern.rs
turbopack/crates/turbopack-core/src/resolve/pattern.rs
+3
-3
node_api_source.rs
...opack/crates/turbopack-node/src/render/node_api_source.rs
+1
-1
execution.rs
turbopack/crates/turbopack-tests/tests/execution.rs
+2
-2
No files found.
crates/napi/src/react_compiler.rs
View file @
e5326844
...
...
@@ -23,7 +23,7 @@ impl Task for CheckTask {
GLOBALS
.set
(
&
Default
::
default
(),
||
{
//
let
cm
=
Arc
::
new
(
SourceMap
::
default
());
let
Ok
(
fm
)
=
cm
.load_file
(
&
self
.filename
.clone
()
)
else
{
let
Ok
(
fm
)
=
cm
.load_file
(
&
self
.filename
)
else
{
return
Ok
(
false
);
};
let
mut
errors
=
vec!
[];
...
...
turbopack/crates/turbopack-core/src/resolve/mod.rs
View file @
e5326844
...
...
@@ -1392,7 +1392,7 @@ async fn find_package(
for
name
in
names
.iter
()
{
let
fs_path
=
lookup_path
.join
(
name
)
?
;
if
let
Some
(
fs_path
)
=
dir_exists
(
fs_path
,
&
mut
affecting_sources
)
.await
?
{
let
fs_path
=
fs_path
.join
(
&
package_name
.clone
()
)
?
;
let
fs_path
=
fs_path
.join
(
&
package_name
)
?
;
if
let
Some
(
fs_path
)
=
dir_exists
(
fs_path
.clone
(),
&
mut
affecting_sources
)
.await
?
{
...
...
@@ -1431,7 +1431,7 @@ async fn find_package(
if
excluded_extensions
.contains
(
extension
)
{
continue
;
}
let
package_file
=
package_dir
.append
(
&
extension
.clone
()
)
?
;
let
package_file
=
package_dir
.append
(
extension
)
?
;
if
let
Some
(
package_file
)
=
exists
(
package_file
,
&
mut
affecting_sources
)
.await
?
{
packages
.push
(
FindPackageItem
::
PackageFile
(
package_file
));
...
...
turbopack/crates/turbopack-core/src/resolve/pattern.rs
View file @
e5326844
...
...
@@ -1631,7 +1631,7 @@ pub async fn read_matches(
prefix
.pop
();
}
if
let
Some
(
pos
)
=
pat
.match_position
(
&
prefix
)
{
let
fs_path
=
lookup_dir
.join
(
&
key
.clone
()
)
?
;
let
fs_path
=
lookup_dir
.join
(
key
)
?
;
if
let
LinkContent
::
Link
{
link_type
,
..
}
=
&*
fs_path
.read_link
()
.await
?
{
...
...
@@ -1653,7 +1653,7 @@ pub async fn read_matches(
}
prefix
.push
(
'/'
);
if
let
Some
(
pos
)
=
pat
.match_position
(
&
prefix
)
{
let
fs_path
=
lookup_dir
.join
(
&
key
.clone
()
)
?
;
let
fs_path
=
lookup_dir
.join
(
key
)
?
;
if
let
LinkContent
::
Link
{
link_type
,
..
}
=
&*
fs_path
.read_link
()
.await
?
&&
link_type
.contains
(
LinkType
::
DIRECTORY
)
...
...
@@ -1665,7 +1665,7 @@ pub async fn read_matches(
}
}
if
let
Some
(
pos
)
=
pat
.could_match_position
(
&
prefix
)
{
let
fs_path
=
lookup_dir
.join
(
&
key
.clone
()
)
?
;
let
fs_path
=
lookup_dir
.join
(
key
)
?
;
if
let
LinkContent
::
Link
{
link_type
,
..
}
=
&*
fs_path
.read_link
()
.await
?
&&
link_type
.contains
(
LinkType
::
DIRECTORY
)
...
...
turbopack/crates/turbopack-node/src/render/node_api_source.rs
View file @
e5326844
...
...
@@ -127,7 +127,7 @@ impl GetContentSourceContent for NodeApiContentSource {
Ok
(
ContentSourceContent
::
HttpProxy
(
render_proxy_operation
(
self
.cwd
.clone
(),
self
.env
,
self
.server_root
.join
(
&
path
.clone
()
)
?
,
self
.server_root
.join
(
&
path
)
?
,
ResolvedVc
::
upcast
(
entry
.module
),
entry
.runtime_entries
,
entry
.chunking_context
,
...
...
turbopack/crates/turbopack-tests/tests/execution.rs
View file @
e5326844
...
...
@@ -291,8 +291,8 @@ async fn prepare_test(resource: RcStr) -> Result<Vc<PreparedTest>> {
resource_path
.display
()
))
?
;
let
relative_path
:
RcStr
=
sys_to_unix
(
relative_path
.to_str
()
.unwrap
())
.into
();
let
path
=
root_fs
.root
()
.await
?
.join
(
&
relative_path
.clone
()
)
?
;
let
project_path
=
project_root
.join
(
&
relative_path
.clone
()
)
?
;
let
path
=
root_fs
.root
()
.await
?
.join
(
&
relative_path
)
?
;
let
project_path
=
project_root
.join
(
&
relative_path
)
?
;
let
tests_path
=
project_fs
.root
()
.await
?
...
...
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