From 8ee971dfbbf8f3a640511ef9dc17e4e1176994ba Mon Sep 17 00:00:00 2001 From: konstin Date: Wed, 17 Apr 2024 10:31:49 +0200 Subject: [PATCH] Improve docs --- examples/caching_dependency_provider.rs | 2 +- src/solver.rs | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/caching_dependency_provider.rs b/examples/caching_dependency_provider.rs index 5669b5ff..683df4b5 100644 --- a/examples/caching_dependency_provider.rs +++ b/examples/caching_dependency_provider.rs @@ -32,7 +32,7 @@ impl> DependencyProvider for CachingDependenc ) -> Result, DP::Err> { let mut cache = self.cached_dependencies.borrow_mut(); match cache.get_dependencies(package, version) { - Ok(Dependencies::Unknown(reason)) => { + Ok(Dependencies::Unknown(_)) => { let dependencies = self.remote_dependencies.get_dependencies(package, version); match dependencies { Ok(Dependencies::Known(dependencies)) => { diff --git a/src/solver.rs b/src/solver.rs index dc0e8357..821fbf1e 100644 --- a/src/solver.rs +++ b/src/solver.rs @@ -206,10 +206,14 @@ pub trait DependencyProvider { type P: Package; /// How this provider stores the versions of the packages. + /// + /// A common choice is [`SemanticVersion`][crate::version::SemanticVersion]. type V: Debug + Display + Clone + Ord; /// How this provider stores the version requirements for the packages. /// The requirements must be able to process the same kind of version as this dependency provider. + /// + /// A common choice is [`Range`][crate::range::Range]. type VS: VersionSet; /// Type for custom incompatibilities. @@ -218,8 +222,10 @@ pub trait DependencyProvider { /// to be unavailable. Examples: /// * The version would require building the package, but builds are disabled. /// * The package is not available in the cache, but internet access has been disabled. - /// The intended use is to track them in an enum and assign them to this type. This also - /// supports collapsing custom incompatibilities in error messages. + /// * The package uses a legacy format not supported anymore. + /// + /// The intended use is to track them in an enum and assign them to this type. You can also + /// assign [`String`] as placeholder. type M: Eq + Clone + Debug + Display; /// [Decision making](https://github.com/dart-lang/pub/blob/master/doc/solver.md#decision-making)