Skip to content

Commit 6880f75

Browse files
committed
replace OnceCell with OnceLock to better model the behavior before switching to the std components
1 parent 63c24a3 commit 6880f75

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/external_command/rustup_command.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@ impl RustupCommand {
121121

122122
Ok(RustupOutput {
123123
output,
124-
stdout: std::cell::OnceCell::new(),
125-
stderr: std::cell::OnceCell::new(),
124+
stdout: std::sync::OnceLock::new(),
125+
stderr: std::sync::OnceLock::new(),
126126
})
127127
}
128128
}
129129

130130
pub struct RustupOutput {
131131
output: std::process::Output,
132-
stdout: std::cell::OnceCell<String>,
133-
stderr: std::cell::OnceCell<String>,
132+
stdout: std::sync::OnceLock<String>,
133+
stderr: std::sync::OnceLock<String>,
134134
}
135135

136136
impl RustupOutput {

src/rust/toolchain.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rust_releases::semver;
2-
use std::cell::OnceCell;
2+
use std::sync::OnceLock;
33

44
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize)]
55
#[serde(rename_all = "snake_case")]
@@ -8,7 +8,7 @@ pub struct Toolchain {
88
target: &'static str,
99
components: &'static [&'static str],
1010
#[serde(skip)]
11-
spec: OnceCell<String>,
11+
spec: OnceLock<String>,
1212
}
1313

1414
impl Toolchain {
@@ -21,7 +21,7 @@ impl Toolchain {
2121
version,
2222
target,
2323
components,
24-
spec: OnceCell::new(),
24+
spec: OnceLock::new(),
2525
}
2626
}
2727

0 commit comments

Comments
 (0)