@@ -161,8 +161,8 @@ impl fmt::Display for MyError {
161161}
162162
163163pub struct BuildStepper {
164- steps : Vec < Box < dyn for < ' a > Fn ( & ' a Repository , String ) -> Result < String , MyError > > > ,
165- tests : Vec < Box < dyn for < ' a > Fn ( & ' a mut Command , & Option < String > ) -> Option < String > > > ,
164+ steps : Vec < ( String , Box < dyn for < ' a > Fn ( & ' a Repository , String ) -> Result < String , MyError > > ) > ,
165+ tests : Vec < ( String , Box < dyn for < ' a > Fn ( & ' a mut Command , & Option < String > ) -> Option < String > > ) > ,
166166}
167167
168168impl BuildStepper {
@@ -178,9 +178,8 @@ impl BuildStepper {
178178 F : for < ' a > Fn ( & ' a Repository , String ) -> Result < String , MyError > + ' static ,
179179 G : for < ' a > Fn ( & ' a mut Command , & Option < String > ) -> Option < String > + ' static ,
180180 {
181- println ! ( "Building chapter {name}" ) ;
182- self . steps . push ( Box :: new ( step) ) ;
183- self . tests . push ( Box :: new ( test) ) ;
181+ self . steps . push ( ( name. to_string ( ) , Box :: new ( step) ) ) ;
182+ self . tests . push ( ( name. to_string ( ) , Box :: new ( test) ) ) ;
184183 self
185184 }
186185
@@ -214,7 +213,8 @@ impl BuildStepper {
214213 let reference: Reference = repo. find_reference ( "HEAD" ) . unwrap ( ) ;
215214 let mut next = get_hash_str ( & reference) ;
216215
217- for step in self . steps . iter ( ) . rev ( ) {
216+ for ( name, step) in self . steps . iter ( ) . rev ( ) {
217+ println ! ( "\x1b [93mexecuting {name}\x1b [0m" ) ;
218218 next = match step ( & repo, next) {
219219 Ok ( next) => next,
220220 Err ( err) => panic ! ( "Error: {err}" ) ,
@@ -225,7 +225,8 @@ impl BuildStepper {
225225 #[ allow( unused) ]
226226 pub fn test ( self ) {
227227 let mut prev_out: Option < String > = None ;
228- for step in self . tests . iter ( ) {
228+ for ( name, step) in self . tests . iter ( ) {
229+ println ! ( "\x1b [93mtesting {name}\x1b [0m" ) ;
229230 let mut git = Command :: new ( "git" ) ;
230231 git. args ( [ "-C" , REPO_PATH ] ) ;
231232 prev_out = step ( & mut git, & prev_out) ;
0 commit comments