blob: bbeda723c9a44b4e5a3897abe6e934cd50c3a8c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
use ra_ide_api::FileId;
use rustc_hash::FxHashSet;
#[derive(Default, Debug)]
pub(crate) struct Subscriptions {
subs: FxHashSet<FileId>,
}
impl Subscriptions {
pub(crate) fn add_sub(&mut self, file_id: FileId) {
self.subs.insert(file_id);
}
pub(crate) fn remove_sub(&mut self, file_id: FileId) {
self.subs.remove(&file_id);
}
pub(crate) fn subscriptions(&self) -> Vec<FileId> {
self.subs.iter().cloned().collect()
}
}
|