@@ -161,10 +161,6 @@ impl StyledText for LeafLineBuilder {
161161 self
162162 }
163163
164- fn indent < T : Display > ( self , indent : usize , s : T ) -> Self {
165- self . pad ( ' ' , indent, s)
166- }
167-
168164 fn align_left < T : Display > ( self , s : T , width : usize ) -> Self {
169165 self . pad_right ( ' ' , s, width)
170166 }
@@ -197,11 +193,25 @@ impl StyledText for LeafLineBuilder {
197193 self
198194 }
199195
200- fn choose < T : Display > ( mut self , condition : bool , when_true : T , when_false : T ) -> Self {
196+ fn fill ( mut self , ch : char , width : usize ) -> Self {
197+ self . text = self . text . fill ( ch, width) ;
198+ self
199+ }
200+
201+ fn choose < T : Display , F : Display > ( mut self , condition : bool , when_true : T , when_false : F ) -> Self {
201202 self . text = self . text . choose ( condition, when_true, when_false) ;
202203 self
203204 }
204205
206+ fn matches < C : IntoIterator < Item = ( bool , impl Display ) > > ( mut self , conditions : C ) -> Self {
207+ self . text = self . text . matches ( conditions) ;
208+ self
209+ }
210+
211+ fn indent < T : Display > ( self , indent : usize , s : T ) -> Self {
212+ self . pad ( ' ' , indent, s)
213+ }
214+
205215 fn bold ( mut self ) -> Self {
206216 self . text = self . text . bold ( ) ;
207217 self
@@ -436,11 +446,6 @@ impl StyledText for LeafLineBuilder {
436446 self . text = self . text . bg_color_rgb ( c) ;
437447 self
438448 }
439-
440- fn fill ( mut self , ch : char , width : usize ) -> Self {
441- self . text = self . text . fill ( ch, width) ;
442- self
443- }
444449}
445450
446451/// Builder for [TreeNode::Node].
@@ -543,10 +548,6 @@ impl StyledText for NodeLineBuilder {
543548 self
544549 }
545550
546- fn indent < T : Display > ( self , indent : usize , s : T ) -> Self {
547- self . pad ( ' ' , indent, s)
548- }
549-
550551 fn align_left < T : Display > ( self , s : T , width : usize ) -> Self {
551552 self . pad_right ( ' ' , s, width)
552553 }
@@ -579,11 +580,25 @@ impl StyledText for NodeLineBuilder {
579580 self
580581 }
581582
582- fn choose < T : Display > ( mut self , condition : bool , when_true : T , when_false : T ) -> Self {
583+ fn fill ( mut self , ch : char , width : usize ) -> Self {
584+ self . text = self . text . fill ( ch, width) ;
585+ self
586+ }
587+
588+ fn choose < T : Display , F : Display > ( mut self , condition : bool , when_true : T , when_false : F ) -> Self {
583589 self . text = self . text . choose ( condition, when_true, when_false) ;
584590 self
585591 }
586592
593+ fn matches < C : IntoIterator < Item = ( bool , impl Display ) > > ( mut self , conditions : C ) -> Self {
594+ self . text = self . text . matches ( conditions) ;
595+ self
596+ }
597+
598+ fn indent < T : Display > ( self , indent : usize , s : T ) -> Self {
599+ self . pad ( ' ' , indent, s)
600+ }
601+
587602 fn bold ( mut self ) -> Self {
588603 self . text = self . text . bold ( ) ;
589604 self
@@ -818,9 +833,4 @@ impl StyledText for NodeLineBuilder {
818833 self . text = self . text . bg_color_rgb ( c) ;
819834 self
820835 }
821-
822- fn fill ( mut self , ch : char , width : usize ) -> Self {
823- self . text = self . text . fill ( ch, width) ;
824- self
825- }
826836}
0 commit comments