Skip to content

Commit 8d18234

Browse files
Yue Feirami3l
Yue Fei
authored andcommitted
Remove unnecessary methods
1 parent bce3ed6 commit 8d18234

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/cli/self_update/windows.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -809,11 +809,7 @@ pub struct RegistryValueId {
809809

810810
#[cfg(any(test, feature = "test"))]
811811
impl RegistryValueId {
812-
pub fn get_value(&self) -> Result<Option<Value>> {
813-
self.get()
814-
}
815-
816-
fn get(&self) -> Result<Option<Value>> {
812+
pub fn get(&self) -> Result<Option<Value>> {
817813
let sub_key = CURRENT_USER.create(self.sub_key)?;
818814
match sub_key.get_value(self.value_name) {
819815
Ok(val) => Ok(Some(val)),
@@ -822,11 +818,7 @@ impl RegistryValueId {
822818
}
823819
}
824820

825-
pub fn set_value(&self, new: Option<&Value>) -> Result<()> {
826-
self.set(new)
827-
}
828-
829-
fn set(&self, new: Option<&Value>) -> Result<()> {
821+
pub fn set(&self, new: Option<&Value>) -> Result<()> {
830822
let sub_key = CURRENT_USER.create(self.sub_key)?;
831823
match new {
832824
Some(new) => Ok(sub_key.set_value(self.value_name, new)?),

tests/suite/cli_self_upd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,11 @@ async fn update_overwrites_programs_display_version() {
352352
.await;
353353

354354
USER_RUSTUP_VERSION
355-
.set_value(Some(&Value::from(PLACEHOLDER_VERSION)))
355+
.set(Some(&Value::from(PLACEHOLDER_VERSION)))
356356
.unwrap();
357357
cx.config.expect_ok(&["rustup", "self", "update"]).await;
358358
assert_eq!(
359-
USER_RUSTUP_VERSION.get_value().unwrap().unwrap(),
359+
USER_RUSTUP_VERSION.get().unwrap().unwrap(),
360360
Value::from(version)
361361
);
362362
}

0 commit comments

Comments
 (0)