cleanup on uninstall

This commit is contained in:
Aiden McClelland
2024-07-26 01:42:10 -06:00
parent e4782dee68
commit a743785faf
2 changed files with 71 additions and 11 deletions

View File

@@ -63,6 +63,18 @@ impl PackageState {
)),
}
}
pub fn expect_removing(&self) -> Result<&InstalledState, Error> {
match self {
Self::Removing(a) => Ok(a),
_ => Err(Error::new(
eyre!(
"Package {} is not in removing state",
self.as_manifest(ManifestPreference::Old).id
),
ErrorKind::InvalidRequest,
)),
}
}
pub fn into_installing_info(self) -> Option<InstallingInfo> {
match self {
Self::Installing(InstallingState { installing_info })