@@ -13,9 +13,8 @@ use anyhow::{bail, Context, Result};
1313use futures_util:: TryStreamExt ;
1414use indexmap:: { IndexMap , IndexSet } ;
1515use petgraph:: {
16- acyclic:: { Acyclic , AcyclicEdgeError } ,
16+ acyclic:: Acyclic ,
1717 graph:: { DiGraph , NodeIndex } ,
18- Graph ,
1918} ;
2019use semver:: { Comparator , Op , Version , VersionReq } ;
2120use tokio:: io:: { AsyncRead , AsyncReadExt } ;
@@ -882,7 +881,7 @@ pub struct PublishPlan {
882881
883882impl PublishPlan {
884883 /// Generate [`Self`] from a list of WIT package paths (files or directories).
885- fn from_paths ( paths : & [ impl AsRef < Path > ] ) -> Result < Self > {
884+ pub fn from_paths ( paths : & [ impl AsRef < Path > ] ) -> Result < Self > {
886885 let ( graph, indices) = get_local_dependencies ( paths) ?;
887886 let mut dependents = graph. into_inner ( ) ;
888887 dependents. reverse ( ) ;
@@ -895,22 +894,22 @@ impl PublishPlan {
895894 } )
896895 }
897896
898- fn iter < ' a > ( & ' a self ) -> impl Iterator < Item = & ' a PackageRef > + ' a {
897+ pub fn iter < ' a > ( & ' a self ) -> impl Iterator < Item = & ' a PackageRef > + ' a {
899898 self . indices . iter ( ) . map ( |( pkg, _) | pkg)
900899 }
901900
902- fn is_empty ( & self ) -> bool {
901+ pub fn is_empty ( & self ) -> bool {
903902 self . indices . is_empty ( )
904903 }
905904
906- fn len ( & self ) -> usize {
905+ pub fn len ( & self ) -> usize {
907906 self . indices . len ( )
908907 }
909908
910909 /// Returns the set of packages that are ready for publishing (i.e. have no outstanding dependencies).
911910 ///
912911 /// These will not be returned in future calls.
913- fn take_ready ( & mut self ) -> BTreeSet < PackageRef > {
912+ pub fn take_ready ( & mut self ) -> BTreeSet < PackageRef > {
914913 self . dependents
915914 . nodes_iter ( )
916915 // there are no dependents on `self.dendents[id]`
@@ -925,7 +924,7 @@ impl PublishPlan {
925924
926925 /// Packages confirmed to be available in the registry, potentially allowing additional
927926 /// packages to be "ready".
928- fn mark_confirmed ( & mut self , published : impl IntoIterator < Item = PackageRef > ) {
927+ pub fn mark_confirmed ( & mut self , published : impl IntoIterator < Item = PackageRef > ) {
929928 for pkg in published {
930929 let id = self
931930 . indices
@@ -943,7 +942,7 @@ impl PublishPlan {
943942/// e.g. "foo:a@0.1.0, bar:b@0.2.0, and baz:c@0.3.0".
944943///
945944/// Note: the final separator (e.g. "and" in the previous example) can be chosen.
946- fn package_list ( pkgs : impl IntoIterator < Item = PackageRef > , final_sep : & str ) -> String {
945+ pub fn package_list ( pkgs : impl IntoIterator < Item = PackageRef > , final_sep : & str ) -> String {
947946 let mut names: Vec < _ > = pkgs. into_iter ( ) . map ( |pkg| pkg. to_string ( ) ) . collect ( ) ;
948947 names. sort ( ) ;
949948
0 commit comments