File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,12 @@ impl<'a> TypingPredicate<'a> {
221
221
. to_display_tree ( a)
222
222
. sep_then ( a, ": " , ty) ;
223
223
224
- pre_turnstile. sep_then ( a, " ⊢ " , post_turnstile)
224
+ let parts: & [ _ ] = if pre_turnstile. is_empty ( ) {
225
+ & [ post_turnstile]
226
+ } else {
227
+ & [ pre_turnstile, post_turnstile]
228
+ } ;
229
+ DisplayTree :: sep_by ( a, " ⊢ " , parts)
225
230
}
226
231
}
227
232
}
Original file line number Diff line number Diff line change @@ -77,6 +77,13 @@ fn strip_markup(s: &str) -> String {
77
77
}
78
78
79
79
impl < ' a > DisplayTree < ' a > {
80
+ pub fn is_empty ( & self ) -> bool {
81
+ match self . kind {
82
+ Leaf ( s) => s. is_empty ( ) ,
83
+ Separated { children, .. } => children. is_empty ( ) ,
84
+ }
85
+ }
86
+
80
87
pub fn len_ignoring_markup ( & self ) -> usize {
81
88
match self . kind {
82
89
Leaf ( s) => len_ignoring_markup ( s) ,
You can’t perform that action at this time.
0 commit comments