Skip to content
This repository was archived by the owner on Feb 28, 2023. It is now read-only.

Commit 77828ad

Browse files
committed
Mark ClientToolchains::put_toolchain as synchronous
It seems entirely synchronous, as it doesn't hit any await points and additionally seems to be trigger-happy with mutex locks in inner calls, so better be safe and prevent the future reader from thinking that this function is async-safe.
1 parent edce5ab commit 77828ad

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/dist/cache.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ mod client {
176176
Ok(Some(file))
177177
}
178178
// If the toolchain doesn't already exist, create it and insert into the cache
179-
pub async fn put_toolchain(
179+
pub fn put_toolchain(
180180
&self,
181181
compiler_path: PathBuf,
182182
weak_key: String,
@@ -323,7 +323,7 @@ mod client {
323323
"/my/compiler".into(),
324324
"weak_key".to_owned(),
325325
PanicToolchainPackager::new(),
326-
).wait()
326+
)
327327
.unwrap();
328328
assert!(newpath.unwrap() == ("/my/compiler/in_archive".to_string(), ct1));
329329
}
@@ -368,23 +368,23 @@ mod client {
368368
"/my/compiler".into(),
369369
"weak_key".to_owned(),
370370
PanicToolchainPackager::new(),
371-
).wait()
371+
)
372372
.unwrap();
373373
assert!(newpath.unwrap() == ("/my/compiler/in_archive".to_string(), ct1.clone()));
374374
let (_tc, newpath) = client_toolchains
375375
.put_toolchain(
376376
"/my/compiler2".into(),
377377
"weak_key2".to_owned(),
378378
PanicToolchainPackager::new(),
379-
).wait()
379+
)
380380
.unwrap();
381381
assert!(newpath.unwrap() == ("/my/compiler2/in_archive".to_string(), ct1.clone()));
382382
let (_tc, newpath) = client_toolchains
383383
.put_toolchain(
384384
"/my/compiler3".into(),
385385
"weak_key2".to_owned(),
386386
PanicToolchainPackager::new(),
387-
).wait()
387+
)
388388
.unwrap();
389389
assert!(newpath.unwrap() == ("/my/compiler/in_archive".to_string(), ct1));
390390
}
@@ -410,7 +410,7 @@ mod client {
410410
"/my/compiler".into(),
411411
"weak_key".to_owned(),
412412
PanicToolchainPackager::new()
413-
).wait()
413+
)
414414
.is_err());
415415
}
416416

src/dist/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ mod client {
13461346
let pool = self.pool.clone();
13471347

13481348
pool.spawn_with_handle(async move {
1349-
tc_cache.put_toolchain(compiler_path, weak_key, toolchain_packager).await
1349+
tc_cache.put_toolchain(compiler_path, weak_key, toolchain_packager)
13501350
})?
13511351
.await
13521352
}

0 commit comments

Comments
 (0)