(
&self,
f: &mut fmt::Formatter<'_>,
ctx: &mut PlanRenderingContext<'_, HirRelationExpr>,
)
| 49 | |
| 50 | impl HirRelationExpr { |
| 51 | fn fmt_virtual_syntax( |
| 52 | &self, |
| 53 | f: &mut fmt::Formatter<'_>, |
| 54 | ctx: &mut PlanRenderingContext<'_, HirRelationExpr>, |
| 55 | ) -> fmt::Result { |
| 56 | if let Some(Except { all, lhs, rhs }) = Hir::un_except(self) { |
| 57 | if all { |
| 58 | writeln!(f, "{}ExceptAll", ctx.indent)?; |
| 59 | } else { |
| 60 | writeln!(f, "{}Except", ctx.indent)?; |
| 61 | } |
| 62 | ctx.indented(|ctx| { |
| 63 | lhs.fmt_text(f, ctx)?; |
| 64 | rhs.fmt_text(f, ctx)?; |
| 65 | Ok(()) |
| 66 | })?; |
| 67 | } else { |
| 68 | // fallback to raw syntax formatting as a last resort |
| 69 | self.fmt_raw_syntax(f, ctx)?; |
| 70 | } |
| 71 | |
| 72 | Ok(()) |
| 73 | } |
| 74 | |
| 75 | fn fmt_raw_syntax( |
| 76 | &self, |
no test coverage detected