Skip to content

Commit

Permalink
Remove unnecessary methods
Browse files Browse the repository at this point in the history
  • Loading branch information
InfyniteHeap authored and rami3l committed Sep 26, 2024
1 parent bce3ed6 commit 8d18234
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/cli/self_update/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,11 +809,7 @@ pub struct RegistryValueId {

#[cfg(any(test, feature = "test"))]
impl RegistryValueId {
pub fn get_value(&self) -> Result<Option<Value>> {
self.get()
}

fn get(&self) -> Result<Option<Value>> {
pub fn get(&self) -> Result<Option<Value>> {
let sub_key = CURRENT_USER.create(self.sub_key)?;
match sub_key.get_value(self.value_name) {
Ok(val) => Ok(Some(val)),
Expand All @@ -822,11 +818,7 @@ impl RegistryValueId {
}
}

pub fn set_value(&self, new: Option<&Value>) -> Result<()> {
self.set(new)
}

fn set(&self, new: Option<&Value>) -> Result<()> {
pub fn set(&self, new: Option<&Value>) -> Result<()> {
let sub_key = CURRENT_USER.create(self.sub_key)?;
match new {
Some(new) => Ok(sub_key.set_value(self.value_name, new)?),
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/cli_self_upd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@ async fn update_overwrites_programs_display_version() {
.await;

USER_RUSTUP_VERSION
.set_value(Some(&Value::from(PLACEHOLDER_VERSION)))
.set(Some(&Value::from(PLACEHOLDER_VERSION)))
.unwrap();
cx.config.expect_ok(&["rustup", "self", "update"]).await;
assert_eq!(
USER_RUSTUP_VERSION.get_value().unwrap().unwrap(),
USER_RUSTUP_VERSION.get().unwrap().unwrap(),
Value::from(version)
);
}
Expand Down

0 comments on commit 8d18234

Please sign in to comment.