feat(sdk): Remove SlidingSync::pop_list.

This method is used by nobody. It's safe to remove it.
This commit is contained in:
Ivan Enderlin
2023-04-05 10:30:49 +02:00
parent f8e4e3d7d5
commit f4e577bbe0
3 changed files with 3 additions and 17 deletions

View File

@@ -756,10 +756,6 @@ impl SlidingSync {
self.inner.add_list(list.inner.clone()).map(|inner| Arc::new(SlidingSyncList { inner }))
}
pub fn pop_list(&self, name: String) -> Option<Arc<SlidingSyncList>> {
self.inner.pop_list(&name).map(|inner| Arc::new(SlidingSyncList { inner }))
}
pub fn add_common_extensions(&self) {
self.inner.add_common_extensions();
}

View File

@@ -196,16 +196,6 @@ impl SlidingSync {
self.inner.lists.read().unwrap().get(list_name).cloned()
}
/// Remove the SlidingSyncList named `list_name` from the lists list if
/// found.
///
/// Note: Remember that this change will only be applicable for any new
/// stream created after this. The old stream will still continue to use the
/// previous set of lists.
pub fn pop_list(&self, list_name: &String) -> Option<SlidingSyncList> {
self.inner.lists.write().unwrap().remove(list_name)
}
/// Add the list to the list of lists.
///
/// As lists need to have a unique `.name`, if a list with the same name

View File

@@ -448,9 +448,9 @@ async fn live_lists() -> anyhow::Result<()> {
// we only heard about the ones we had asked for
assert_eq!(summary.lists, [list_name_1, list_name_2, list_name_3]);
let Some(list_2) = sync_proxy.pop_list(&list_name_2.to_owned()) else {
bail!("Room exists");
};
let Some(list_2) = sync_proxy.get_list(&list_name_2.to_owned()) else {
bail!("Room exists");
};
// we need to restart the stream after every list listing update
let stream = sync_proxy.stream();