diff --git a/01-problem/src/main.rs b/01-problem/src/main.rs
index d8930c9..22c551a 100644
--- a/01-problem/src/main.rs
+++ b/01-problem/src/main.rs
@@ -13,7 +13,7 @@ impl CredentialManager {
}
}
- pub fn unlock(&self, master_secret: &str) {
+ pub fn unlock(&mut self, master_secret: &str) {
todo!()
}
@@ -21,11 +21,11 @@ impl CredentialManager {
todo!()
}
- pub fn get(&mut self, key: &str) -> Option<&str> {
+ pub fn get(&self, key: &str) -> Option<&str> {
todo!()
}
- pub fn lock(&self) {
+ pub fn lock(&mut self) {
todo!()
}
}
diff --git a/02-runtime-check/src/main.rs b/02-runtime-check/src/main.rs
index bf9cd4b..70bfc3d 100644
--- a/02-runtime-check/src/main.rs
+++ b/02-runtime-check/src/main.rs
@@ -15,10 +15,11 @@ impl CredentialManager {
}
}
- pub fn unlock(&self, master_secret: &str) -> Result<(), &'static str> {
+ pub fn unlock(&mut self, master_secret: &str) -> Result<(), &'static str> {
if !self.locked {
return Err("already unlocked");
}
+ self.locked = false;
todo!()
}
@@ -29,17 +30,18 @@ impl CredentialManager {
todo!()
}
- pub fn get(&mut self, key: &str) -> Result