mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
complete bookmark toggle features
This commit is contained in:
parent
232f67b9cc
commit
c511b97d2d
4 changed files with 34 additions and 2 deletions
|
|
@ -33,6 +33,17 @@ impl Memory {
|
|||
index.insert(request, time);
|
||||
}
|
||||
|
||||
/// Check request exist in memory index
|
||||
pub fn delete(&self, request: &str) {
|
||||
// Borrow index to update
|
||||
let mut index = self.index.borrow_mut();
|
||||
|
||||
// Delete record (if exist)
|
||||
if index.get(request).is_some() {
|
||||
index.remove(request);
|
||||
}
|
||||
}
|
||||
|
||||
/// Check request exist in memory index
|
||||
pub fn is_exist(&self, request: &str) -> bool {
|
||||
self.index.borrow().get(request).is_some()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue