@@ -104,8 +104,8 @@ impl Tokens {
104104 }
105105 match ( noun. is_empty ( ) , prep. as_str ( ) , obj. is_empty ( ) ) {
106106 ( false , _, false ) => Action :: Attack ( noun. to_owned ( ) , obj. to_owned ( ) ) ,
107- ( true , _, false ) => Action :: what_do ( & format ! ( "{} {} the {}" , verb , prep , obj ) ) ,
108- ( false , _, true ) => Action :: what_do ( & format ! ( "{} the {} {}" , verb , noun , prep ) ) ,
107+ ( true , _, false ) => Action :: what_do ( & format ! ( "{verb } {prep } the {obj}" ) ) ,
108+ ( false , _, true ) => Action :: what_do ( & format ! ( "{verb } the {noun } {prep}" ) ) ,
109109 ( true , _, true ) => Action :: what_do ( verb) ,
110110 }
111111 }
@@ -135,7 +135,7 @@ impl Tokens {
135135 match prep. as_str ( ) {
136136 "in" => Action :: Walk ( "enter" . to_owned ( ) ) ,
137137 "out" => Action :: Walk ( "exit" . to_owned ( ) ) ,
138- _ => Action :: Clarify ( format ! ( "Where do you want to {}?" , verb ) ) ,
138+ _ => Action :: Clarify ( format ! ( "Where do you want to {verb }?" ) ) ,
139139 }
140140 } else {
141141 Action :: Walk ( noun. to_owned ( ) )
@@ -177,8 +177,8 @@ impl Tokens {
177177 ( true , "on" , false ) => Action :: Wear ( obj. to_owned ( ) ) ,
178178 ( true , "on" , true ) => Action :: what_do ( "put on" ) ,
179179 ( false , _, false ) => Action :: Put ( noun. to_owned ( ) , obj. to_owned ( ) ) ,
180- ( true , _, false ) => Action :: what_do ( & format ! ( "{} {} the {}" , verb , prep , obj ) ) ,
181- ( false , _, true ) => Action :: what_do ( & format ! ( "{} the {} {}" , verb , noun , prep ) ) ,
180+ ( true , _, false ) => Action :: what_do ( & format ! ( "{verb } {prep } the {obj}" ) ) ,
181+ ( false , _, true ) => Action :: what_do ( & format ! ( "{verb } the {noun } {prep}" ) ) ,
182182 ( true , _, true ) => Action :: what_do ( verb) ,
183183 }
184184 }
0 commit comments