This commit is contained in:
zekro committed 2026-07-16 12:28:44 +02:00
1 parent 3d8aa85358
commit c367d3f3ca
4 files changed
+10 -8

No files matched your search

+3 -3
View File
@@ -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!()
}
}
+5 -3
View File
@@ -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<Option<&str>, &'static str> {
pub fn get(&self, key: &str) -> Result<Option<&str>, &'static str> {
if self.locked {
return Err("locked");
}
todo!()
}
pub fn lock(&self) -> Result<(), &'static str> {
pub fn lock(&mut self) -> Result<(), &'static str> {
if self.locked {
return Err("already locked");
}
self.locked = true;
todo!()
}
}
+1 -1
View File
@@ -29,7 +29,7 @@ impl UnlockedCredentialManager {
todo!()
}
pub fn get(&mut self, key: &str) -> Option<&str> {
pub fn get(&self, key: &str) -> Option<&str> {
todo!()
}
+1 -1
View File
@@ -33,7 +33,7 @@ impl CredentialManager<Unlocked> {
todo!()
}
pub fn get(&mut self, key: &str) -> Option<&str> {
pub fn get(&self, key: &str) -> Option<&str> {
todo!()
}