@@ -73,7 +73,7 @@ impl Components {
7373 } )
7474 . collect ( ) )
7575 }
76- pub fn add < ' a > ( & self , name : & str , tx : Transaction < ' a > ) -> ComponentBuilder < ' a > {
76+ pub ( crate ) fn add < ' a > ( & self , name : & str , tx : Transaction < ' a > ) -> ComponentBuilder < ' a > {
7777 ComponentBuilder {
7878 components : self . clone ( ) ,
7979 name : name. to_owned ( ) ,
@@ -85,40 +85,40 @@ impl Components {
8585 let result = self . list ( ) ?;
8686 Ok ( result. into_iter ( ) . find ( |c| ( c. name ( ) == name) ) )
8787 }
88- pub fn prefix ( & self ) -> InstallPrefix {
88+ pub ( crate ) fn prefix ( & self ) -> InstallPrefix {
8989 self . prefix . clone ( )
9090 }
9191}
9292
93- pub struct ComponentBuilder < ' a > {
93+ pub ( crate ) struct ComponentBuilder < ' a > {
9494 components : Components ,
9595 name : String ,
9696 parts : Vec < ComponentPart > ,
9797 tx : Transaction < ' a > ,
9898}
9999
100100impl < ' a > ComponentBuilder < ' a > {
101- pub fn copy_file ( & mut self , path : PathBuf , src : & Path ) -> Result < ( ) > {
101+ pub ( crate ) fn copy_file ( & mut self , path : PathBuf , src : & Path ) -> Result < ( ) > {
102102 self . parts
103103 . push ( ComponentPart ( "file" . to_owned ( ) , path. clone ( ) ) ) ;
104104 self . tx . copy_file ( & self . name , path, src)
105105 }
106- pub fn copy_dir ( & mut self , path : PathBuf , src : & Path ) -> Result < ( ) > {
106+ pub ( crate ) fn copy_dir ( & mut self , path : PathBuf , src : & Path ) -> Result < ( ) > {
107107 self . parts
108108 . push ( ComponentPart ( "dir" . to_owned ( ) , path. clone ( ) ) ) ;
109109 self . tx . copy_dir ( & self . name , path, src)
110110 }
111- pub fn move_file ( & mut self , path : PathBuf , src : & Path ) -> Result < ( ) > {
111+ pub ( crate ) fn move_file ( & mut self , path : PathBuf , src : & Path ) -> Result < ( ) > {
112112 self . parts
113113 . push ( ComponentPart ( "file" . to_owned ( ) , path. clone ( ) ) ) ;
114114 self . tx . move_file ( & self . name , path, src)
115115 }
116- pub fn move_dir ( & mut self , path : PathBuf , src : & Path ) -> Result < ( ) > {
116+ pub ( crate ) fn move_dir ( & mut self , path : PathBuf , src : & Path ) -> Result < ( ) > {
117117 self . parts
118118 . push ( ComponentPart ( "dir" . to_owned ( ) , path. clone ( ) ) ) ;
119119 self . tx . move_dir ( & self . name , path, src)
120120 }
121- pub fn finish ( mut self ) -> Result < Transaction < ' a > > {
121+ pub ( crate ) fn finish ( mut self ) -> Result < Transaction < ' a > > {
122122 // Write component manifest
123123 let path = self . components . rel_component_manifest ( & self . name ) ;
124124 let abs_path = self . components . prefix . abs_path ( & path) ;
@@ -146,10 +146,10 @@ impl<'a> ComponentBuilder<'a> {
146146pub struct ComponentPart ( pub String , pub PathBuf ) ;
147147
148148impl ComponentPart {
149- pub fn encode ( & self ) -> String {
149+ pub ( crate ) fn encode ( & self ) -> String {
150150 format ! ( "{}:{}" , & self . 0 , & self . 1 . to_string_lossy( ) )
151151 }
152- pub fn decode ( line : & str ) -> Option < Self > {
152+ pub ( crate ) fn decode ( line : & str ) -> Option < Self > {
153153 line. find ( ':' )
154154 . map ( |pos| Self ( line[ 0 ..pos] . to_owned ( ) , PathBuf :: from ( & line[ ( pos + 1 ) ..] ) ) )
155155 }
@@ -162,21 +162,21 @@ pub struct Component {
162162}
163163
164164impl Component {
165- pub fn manifest_name ( & self ) -> String {
165+ pub ( crate ) fn manifest_name ( & self ) -> String {
166166 format ! ( "manifest-{}" , & self . name)
167167 }
168- pub fn manifest_file ( & self ) -> PathBuf {
168+ pub ( crate ) fn manifest_file ( & self ) -> PathBuf {
169169 self . components . prefix . manifest_file ( & self . manifest_name ( ) )
170170 }
171- pub fn rel_manifest_file ( & self ) -> PathBuf {
171+ pub ( crate ) fn rel_manifest_file ( & self ) -> PathBuf {
172172 self . components
173173 . prefix
174174 . rel_manifest_file ( & self . manifest_name ( ) )
175175 }
176- pub fn name ( & self ) -> & str {
176+ pub ( crate ) fn name ( & self ) -> & str {
177177 & self . name
178178 }
179- pub fn parts ( & self ) -> Result < Vec < ComponentPart > > {
179+ pub ( crate ) fn parts ( & self ) -> Result < Vec < ComponentPart > > {
180180 let mut result = Vec :: new ( ) ;
181181 for line in utils:: read_file ( "component" , & self . manifest_file ( ) ) ?. lines ( ) {
182182 result. push (
0 commit comments