Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 16fdda34 authored by Scallss's avatar Scallss
Browse files

Implement delete function in Subscriber repository.

parent a9b96f66
No related branches found
No related tags found
No related merge requests found
......@@ -34,5 +34,19 @@ impl SubscriberRepository {
.collect();
}
pub fn delete(product_type: &str, url: &str) -> Option<Subscriber> {
if SUBSCRIBERS.get(product_type).is_none() {
SUBSCRIBERS.insert(String::from(product_type), DashMap::new());
}
let result = SUBSCRIBERS.get(product_type).unwrap()
.remove(url);
if !result.is_none() {
return Some(result.unwrap().1);
}
return None;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment