@@ -118,29 +118,18 @@ where
118
118
)
119
119
} ) ?;
120
120
121
- let workspace_path = temp_dir. path ( ) . join ( "workspace" ) ;
122
-
123
- std:: fs:: create_dir_all ( & workspace_path) . with_context ( || {
124
- format ! (
125
- "Failed to create workspace directory '{}'" ,
126
- workspace_path. display( )
127
- )
128
- } ) ?;
129
-
130
- let workspace_path = SystemPath :: from_std_path ( & workspace_path) . ok_or_else ( || {
131
- anyhow ! (
132
- "Workspace root '{}' in temp directory is not a valid UTF-8 path." ,
133
- workspace_path. display( )
134
- )
135
- } ) ?;
136
-
137
- let workspace_path = SystemPathBuf :: from_utf8_path_buf (
138
- workspace_path
121
+ let root_path = SystemPathBuf :: from_utf8_path_buf (
122
+ root_path
139
123
. as_utf8_path ( )
140
124
. canonicalize_utf8 ( )
141
- . with_context ( || "Failed to canonicalize workspace path." ) ?,
125
+ . with_context ( || "Failed to canonicalize root path." ) ?,
142
126
) ;
143
127
128
+ let workspace_path = root_path. join ( "workspace" ) ;
129
+
130
+ std:: fs:: create_dir_all ( workspace_path. as_std_path ( ) )
131
+ . with_context ( || format ! ( "Failed to create workspace directory '{workspace_path}'" , ) ) ?;
132
+
144
133
for ( relative_path, content) in workspace_files {
145
134
let relative_path = relative_path. as_ref ( ) ;
146
135
let absolute_path = workspace_path. join ( relative_path) ;
@@ -157,7 +146,7 @@ where
157
146
let system = OsSystem :: new ( & workspace_path) ;
158
147
159
148
let workspace = WorkspaceMetadata :: from_path ( & workspace_path, & system) ?;
160
- let search_paths = create_search_paths ( root_path, workspace. root ( ) ) ;
149
+ let search_paths = create_search_paths ( & root_path, workspace. root ( ) ) ;
161
150
162
151
for path in search_paths
163
152
. extra_paths
0 commit comments