correctly handle self as current dependent

This commit is contained in:
Aiden McClelland
2021-12-09 19:58:44 -07:00
committed by Aiden McClelland
parent cf8536da2b
commit a2528a13df
5 changed files with 21 additions and 13 deletions

View File

@@ -197,10 +197,10 @@ pub async fn cleanup_failed<Db: DbHandle>(
#[instrument(skip(db, current_dependencies))]
pub async fn remove_current_dependents<'a, Db: DbHandle, I: IntoIterator<Item = &'a PackageId>>(
db: &mut Db,
id: &PackageId,
id: &'a PackageId,
current_dependencies: I,
) -> Result<(), Error> {
for dep in current_dependencies {
for dep in current_dependencies.into_iter().chain(std::iter::once(id)) {
if let Some(current_dependents) = crate::db::DatabaseModel::new()
.package_data()
.idx_model(dep)