Skip to content

Commit b729060

Browse files
committed
feat(workspace): new function is_member_id to check whether given package_id belongs to ws
1 parent fc00223 commit b729060

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cargo/core/workspace.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ impl<'gctx> Workspace<'gctx> {
591591
self.member_ids.contains(&pkg.package_id())
592592
}
593593

594+
/// Returns true if the given package_id is a member of the workspace.
595+
pub fn is_member_id(&self, package_id: PackageId) -> bool {
596+
self.member_ids.contains(&package_id)
597+
}
598+
594599
pub fn is_ephemeral(&self) -> bool {
595600
self.is_ephemeral
596601
}

0 commit comments

Comments
 (0)