Skip to content

Commit a6c903b

Browse files
author
Rean Fei
committed
Rename other functions
1 parent c12ab89 commit a6c903b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/cli/self_update/test.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn with_saved_global_state<S>(
3333

3434
#[cfg(windows)]
3535
pub fn with_saved_path(f: &mut dyn FnMut()) {
36-
with_saved_reg_value(CURRENT_USER, "Environment", "PATH", f)
36+
with_saved_reg_string(CURRENT_USER, "Environment", "PATH", f)
3737
}
3838

3939
#[cfg(unix)]
@@ -47,10 +47,10 @@ pub fn get_path() -> io::Result<Option<String>> {
4747
}
4848

4949
#[cfg(windows)]
50-
pub fn with_saved_reg_value(root: &Key, subkey: &str, name: &str, f: &mut dyn FnMut()) {
50+
pub fn with_saved_reg_string(root: &Key, subkey: &str, name: &str, f: &mut dyn FnMut()) {
5151
with_saved_global_state(
5252
|| get_reg_string(root, subkey, name),
53-
|p| restore_reg_value(root, subkey, name, p),
53+
|p| restore_reg_string(root, subkey, name, p),
5454
f,
5555
)
5656
}
@@ -66,7 +66,7 @@ fn get_reg_string(root: &Key, subkey: &str, name: &str) -> io::Result<Option<Str
6666
}
6767

6868
#[cfg(windows)]
69-
fn restore_reg_value(root: &Key, subkey: &str, name: &str, p: Option<String>) {
69+
fn restore_reg_string(root: &Key, subkey: &str, name: &str, p: Option<String>) {
7070
let subkey = root.create(subkey).unwrap();
7171
if let Some(p) = p.as_ref() {
7272
subkey.set_string(name, p).unwrap();

src/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::currentprocess::TestProcess;
2020
use crate::dist::TargetTriple;
2121

2222
#[cfg(windows)]
23-
pub use crate::cli::self_update::test::{get_path, with_saved_reg_value};
23+
pub use crate::cli::self_update::test::{get_path, with_saved_reg_string};
2424

2525
// Things that can have environment variables applied to them.
2626
pub trait Env {

tests/suite/cli_self_upd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use rustup::utils::{raw, utils};
2323
use rustup::{for_host, DUP_TOOLS, TOOLS};
2424

2525
#[cfg(windows)]
26-
use rustup::test::with_saved_reg_value;
26+
use rustup::test::with_saved_reg_string;
2727

2828
const TEST_VERSION: &str = "1.1.1";
2929

@@ -321,7 +321,7 @@ fn update_overwrites_programs_display_version() {
321321
let version = env!("CARGO_PKG_VERSION");
322322

323323
update_setup(&|config, _| {
324-
with_saved_reg_value(root, key, name, &mut || {
324+
with_saved_reg_string(root, key, name, &mut || {
325325
config.expect_ok(&["rustup-init", "-y", "--no-modify-path"]);
326326

327327
// root.create_subkey(key)

0 commit comments

Comments
 (0)