File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 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> {
221221 . to_display_tree ( a)
222222 . sep_then ( a, ": " , ty) ;
223223
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)
225230 }
226231 }
227232 }
Original file line number Diff line number Diff line change @@ -77,6 +77,13 @@ fn strip_markup(s: &str) -> String {
7777}
7878
7979impl < ' 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+
8087 pub fn len_ignoring_markup ( & self ) -> usize {
8188 match self . kind {
8289 Leaf ( s) => len_ignoring_markup ( s) ,
You can’t perform that action at this time.
0 commit comments