@@ -157,7 +157,7 @@ index.add_deps("a", (2, 0, 0), &[("b", (1, 0, 0)..)]);
157157### Implementing a dependency provider for the index
158158
159159Since our ` Index ` is ready, we now have to implement the ` DependencyProvider `
160- trait for it. As explained previously, we'll need to differenciate packages
160+ trait for it. As explained previously, we'll need to differentiate packages
161161representing buckets and proxies, so we define the following new ` Package ` type.
162162
163163``` rust
@@ -180,13 +180,15 @@ pub struct Bucket {
180180}
181181```
182182
183- In order to implement the first required method, ` choose_package_version ` , we
184- simply reuse the ` choose_package_with_fewest_versions ` helper function provided
185- by pubgrub. That one requires a list of available versions for each package, so
186- we have to create that list. As explained previously, listing the existing
187- (virtual) versions depend on if the package is a bucket or a proxy. For a bucket
188- package, we simply need to retrieve the original versions and filter out those
189- outside of the bucket.
183+ Any ` prioritize ` will work equally well for this example, even just returning a
184+ constant value.
185+
186+ Let's implement the second function required by a dependency provider,
187+ ` choose_version ` . For that we defined a ` available_versions() ` method on an
188+ ` Index ` to list existing versions of a given package in descending order. As
189+ explained previously, listing the existing (virtual) versions depend on if the
190+ package is a bucket or a proxy. For a bucket package, we simply need to retrieve
191+ the original versions and filter out those outside of the bucket.
190192
191193``` rust
192194match package {
0 commit comments