File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
gix-attributes/src/search Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,29 @@ impl Outcome {
223
223
}
224
224
}
225
225
226
+ impl std:: fmt:: Debug for Outcome {
227
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
228
+ struct AsDisplay < ' a > ( & ' a dyn std:: fmt:: Display ) ;
229
+ impl std:: fmt:: Debug for AsDisplay < ' _ > {
230
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
231
+ self . 0 . fmt ( f)
232
+ }
233
+ }
234
+
235
+ let mut dbg = f. debug_tuple ( "Outcome" ) ;
236
+ if self . selected . is_empty ( ) {
237
+ for match_ in self . iter ( ) {
238
+ dbg. field ( & AsDisplay ( & match_. assignment ) ) ;
239
+ }
240
+ } else {
241
+ for match_ in self . iter_selected ( ) {
242
+ dbg. field ( & AsDisplay ( & match_. assignment ) ) ;
243
+ }
244
+ }
245
+ dbg. finish ( )
246
+ }
247
+ }
248
+
226
249
/// Mutation
227
250
impl MetadataCollection {
228
251
/// Assign order ids to each attribute either in macros (along with macros themselves) or attributes of patterns, and store
You can’t perform that action at this time.
0 commit comments