Skip to content

Commit 30691c9

Browse files
committed
Remove macro
1 parent d1d23ab commit 30691c9

File tree

3 files changed

+217
-149
lines changed

3 files changed

+217
-149
lines changed

crates/uv-distribution-types/src/resolution.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use petgraph::{Directed, Graph};
2-
31
use uv_distribution_filename::DistExtension;
42
use uv_normalize::{ExtraName, GroupName, PackageName};
53
use uv_pep508::MarkerTree;
@@ -8,23 +6,27 @@ use uv_pypi_types::{HashDigest, RequirementSource};
86
use crate::{BuiltDist, Diagnostic, Dist, Name, ResolvedDist, SourceDist};
97

108
/// A set of packages pinned at specific versions.
9+
///
10+
/// This is similar to [`ResolverOutput`], but represents a resolution for a subset of all
11+
/// marker environments. For example, the resolution is guaranteed to contain at most one version
12+
/// for a given package.
1113
#[derive(Debug, Default, Clone)]
1214
pub struct Resolution {
13-
graph: Graph<Node, Edge, Directed>,
15+
graph: petgraph::graph::DiGraph<Node, Edge>,
1416
diagnostics: Vec<ResolutionDiagnostic>,
1517
}
1618

1719
impl Resolution {
1820
/// Create a new resolution from the given pinned packages.
19-
pub fn new(graph: Graph<Node, Edge, Directed>) -> Self {
21+
pub fn new(graph: petgraph::graph::DiGraph<Node, Edge>) -> Self {
2022
Self {
2123
graph,
2224
diagnostics: Vec::new(),
2325
}
2426
}
2527

2628
/// Return the underlying graph of the resolution.
27-
pub fn graph(&self) -> &Graph<Node, Edge, Directed> {
29+
pub fn graph(&self) -> &petgraph::graph::DiGraph<Node, Edge> {
2830
&self.graph
2931
}
3032

@@ -174,10 +176,8 @@ impl Diagnostic for ResolutionDiagnostic {
174176

175177
/// A node in the resolution, along with whether its been filtered out.
176178
///
177-
/// This is similar to [`ResolutionGraph`], but represents a resolution for a single platform.
178-
///
179179
/// We retain filtered nodes as we still need to be able to trace dependencies through the graph
180-
/// (e.g., to determine why a package was install in the resolution).
180+
/// (e.g., to determine why a package was included in the resolution).
181181
#[derive(Debug, Clone)]
182182
pub enum Node {
183183
Root,

0 commit comments

Comments
 (0)