Skip to content

[2/n] [ls-apis] return walked dependencies instead of using a callback#10458

Open
sunshowers wants to merge 1 commit into
mainfrom
sunshowers/spr/2n-ls-apis-return-walked-dependencies-instead-of-using-a-callback
Open

[2/n] [ls-apis] return walked dependencies instead of using a callback#10458
sunshowers wants to merge 1 commit into
mainfrom
sunshowers/spr/2n-ls-apis-return-walked-dependencies-instead-of-using-a-callback

Conversation

@sunshowers
Copy link
Copy Markdown
Contributor

@sunshowers sunshowers commented May 18, 2026

We're going to return more data from this function (the set of omitted nodes that were seen) in an upcoming PR.

I tried out a few different approaches:

  • two callbacks
  • a trait
  • a hybrid approach where we keep the current callback and return the additional data as a value

Based on the prototyping I feel like this ends up being the cleanest approach.

There are no functional changes in this PR.

Best reviewed in conjunction with its dependent PR:

Created using spr 1.3.6-beta.1
/// that package.
///
/// A package reachable by more than one path appears once per path.
pub found: Vec<(&'a Package, DepPath)>,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I make this something like a BTreeMap<&'a Package, Vec<DepPath>>? I didn't feel like it made much of a difference either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant