Skip to content

Commit

Permalink
Rename get_reg_value() to get_reg_string()
Browse files Browse the repository at this point in the history
  • Loading branch information
InfyniteHeap committed Jun 20, 2024
1 parent 199d2f4 commit c12ab89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cli/self_update/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ pub fn with_saved_path(f: &mut dyn FnMut()) {

#[cfg(windows)]
pub fn get_path() -> io::Result<Option<String>> {
get_reg_value(CURRENT_USER, "Environment", "PATH")
get_reg_string(CURRENT_USER, "Environment", "PATH")
}

#[cfg(windows)]
pub fn with_saved_reg_value(root: &Key, subkey: &str, name: &str, f: &mut dyn FnMut()) {
with_saved_global_state(
|| get_reg_value(root, subkey, name),
|| get_reg_string(root, subkey, name),
|p| restore_reg_value(root, subkey, name, p),
f,
)
}

#[cfg(windows)]
fn get_reg_value(root: &Key, subkey: &str, name: &str) -> io::Result<Option<String>> {
fn get_reg_string(root: &Key, subkey: &str, name: &str) -> io::Result<Option<String>> {
let subkey = root.create(subkey)?;
match subkey.get_string(name) {
Ok(val) => Ok(Some(val)),
Expand Down

0 comments on commit c12ab89

Please sign in to comment.