Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement --depth workspace for cargo tree command #14928

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(workspace): new function is_member_id to check whether given p…
…ackage_id belongs to ws
  • Loading branch information
ShoyuVanilla committed Dec 12, 2024
commit b729060b149c43896924b910b6e55eac8a3c77b9
5 changes: 5 additions & 0 deletions src/cargo/core/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,11 @@ impl<'gctx> Workspace<'gctx> {
self.member_ids.contains(&pkg.package_id())
}

/// Returns true if the given package_id is a member of the workspace.
pub fn is_member_id(&self, package_id: PackageId) -> bool {
self.member_ids.contains(&package_id)
}

pub fn is_ephemeral(&self) -> bool {
self.is_ephemeral
}
Expand Down