File tree 6 files changed +11
-12
lines changed
6 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ pub fn write_json(
109
109
ws : & Workspace < ' _ > ,
110
110
value : impl Serialize ,
111
111
) -> Result < ( ) > {
112
- let file = target_dir. open_rw ( file_name, description, ws. config ( ) ) ?;
112
+ let file = target_dir. create_rw ( file_name, description, ws. config ( ) ) ?;
113
113
let file = BufWriter :: new ( & * file) ;
114
114
serde_json:: to_writer ( file, & value)
115
115
. with_context ( || format ! ( "failed to serialize {file_name}" ) ) ?;
@@ -123,7 +123,7 @@ pub fn write_string(
123
123
ws : & Workspace < ' _ > ,
124
124
value : impl ToString ,
125
125
) -> Result < ( ) > {
126
- let mut file = target_dir. open_rw ( file_name, description, ws. config ( ) ) ?;
126
+ let mut file = target_dir. create_rw ( file_name, description, ws. config ( ) ) ?;
127
127
file. write_all ( value. to_string ( ) . as_bytes ( ) ) ?;
128
128
Ok ( ( ) )
129
129
}
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ impl<'c> RegistryClientCache<'c> {
154
154
let dl_fs = self . dl_fs . clone ( ) ;
155
155
move |config : & Config | {
156
156
let tarball_name = package. tarball_name ( ) ;
157
- dl_fs. open_rw ( & tarball_name, & tarball_name, config)
157
+ dl_fs. create_rw ( & tarball_name, & tarball_name, config)
158
158
}
159
159
} ) ;
160
160
Original file line number Diff line number Diff line change @@ -304,7 +304,7 @@ impl<'c> IndexConfigManager<'c> {
304
304
async fn save_in_cache ( & self , index_config : & IndexConfig ) -> Result < ( ) > {
305
305
let mut file = self
306
306
. cache_fs
307
- . open_rw ( & self . cache_file_name , & self . cache_file_name , self . config ) ?
307
+ . create_rw ( & self . cache_file_name , & self . cache_file_name , self . config ) ?
308
308
. into_async ( ) ;
309
309
let json = serde_json:: to_vec ( index_config) ?;
310
310
file. write_all ( & json) . await ?;
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ impl<'f> AdvisoryLock<'f> {
164
164
let file_lock_arc = match slot. upgrade ( ) {
165
165
Some ( arc) => arc,
166
166
None => {
167
- let arc = Arc :: new ( self . filesystem . open_rw (
167
+ let arc = Arc :: new ( self . filesystem . create_rw (
168
168
& self . path ,
169
169
& self . description ,
170
170
self . config ,
@@ -249,7 +249,7 @@ impl Filesystem {
249
249
///
250
250
/// The returned file can be accessed to look at the path and also has read/write access to
251
251
/// the underlying file.
252
- pub fn open_rw (
252
+ pub fn create_rw (
253
253
& self ,
254
254
path : impl AsRef < Utf8Path > ,
255
255
description : & str ,
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ fn package_one_impl(
163
163
let target_dir = ws. target_dir ( ) . child ( "package" ) ;
164
164
165
165
let mut dst =
166
- target_dir. open_rw ( format ! ( ".{filename}" ) , "package scratch space" , ws. config ( ) ) ?;
166
+ target_dir. create_rw ( format ! ( ".{filename}" ) , "package scratch space" , ws. config ( ) ) ?;
167
167
168
168
dst. set_len ( 0 )
169
169
. with_context ( || format ! ( "failed to truncate: {filename}" ) ) ?;
Original file line number Diff line number Diff line change @@ -25,11 +25,10 @@ fn locking_build_artifacts() {
25
25
26
26
thread:: scope ( |s| {
27
27
let ws = scarb:: ops:: read_workspace ( config. manifest_path ( ) , & config) . unwrap ( ) ;
28
- let lock = ws. target_dir ( ) . child ( config. profile ( ) . to_string ( ) ) . open_rw (
29
- "hello.sierra.json" ,
30
- "artifact" ,
31
- & config,
32
- ) ;
28
+ let lock = ws
29
+ . target_dir ( )
30
+ . child ( config. profile ( ) . to_string ( ) )
31
+ . create_rw ( "hello.sierra.json" , "artifact" , & config) ;
33
32
let barrier = Arc :: new ( Barrier :: new ( 2 ) ) ;
34
33
35
34
s. spawn ( {
You can’t perform that action at this time.
0 commit comments