fix: cleanup for buffer fixture

idk who made this?? it was already fixed in dev env, uncommitted

Co-authored-by: cschen <cschen@codemp.dev>
Co-authored-by: zaaarf <me@zaaarf.foo>
This commit is contained in:
əlemi 2024-11-05 00:18:06 +01:00
parent c42b091b63
commit 300f6620c0
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -237,14 +237,16 @@ impl
async fn cleanup( async fn cleanup(
&mut self, &mut self,
mut resource: Option<( resource: Option<(
(crate::Client, crate::Workspace, crate::buffer::Controller), (crate::Client, crate::Workspace, crate::buffer::Controller),
(crate::Client, crate::Workspace, crate::buffer::Controller), (crate::Client, crate::Workspace, crate::buffer::Controller),
)>, )>,
) { ) {
if let Some(((_, ws, buf), (_, _, _))) = resource.take() { if let Some(((client, _, _), (_, _, _))) = resource {
if let Err(e) = ws.delete_buffer(buf.path()).await { // buffer deletion is implied in workspace deletion
eprintln!("could not delete buffer: {e:?}"); client.leave_workspace(&self.workspace);
if let Err(e) = client.delete_workspace(&self.workspace).await {
eprintln!("could not delete workspace: {e}");
} }
} }
} }