Remove unused ast::Expr::Expect

This commit is contained in:
JRI98 2024-11-18 14:13:46 +00:00
parent 64cd70c1da
commit de4179d5e1
No known key found for this signature in database
GPG key ID: F83B29916FF13F24
8 changed files with 0 additions and 132 deletions

View file

@ -64,9 +64,6 @@ impl<'a> Formattable for Expr<'a> {
loc_expr.is_multiline() || args.iter().any(|loc_arg| loc_arg.is_multiline())
}
Expect(condition, continuation) => {
condition.is_multiline() || continuation.is_multiline()
}
DbgStmt(condition, _) => condition.is_multiline(),
LowLevelDbg(_, _, _) => unreachable!(
"LowLevelDbg should only exist after desugaring, not during formatting"
@ -445,9 +442,6 @@ impl<'a> Formattable for Expr<'a> {
buf.push(')');
}
}
Expect(condition, continuation) => {
fmt_expect(buf, condition, continuation, self.is_multiline(), indent);
}
Dbg => {
buf.indent(indent);
buf.push_str("dbg");
@ -1071,33 +1065,6 @@ fn fmt_dbg_stmt<'a>(
continuation.format(buf, indent);
}
fn fmt_expect<'a>(
buf: &mut Buf,
condition: &'a Loc<Expr<'a>>,
continuation: &'a Loc<Expr<'a>>,
is_multiline: bool,
indent: u16,
) {
buf.ensure_ends_with_newline();
buf.indent(indent);
buf.push_str("expect");
let return_indent = if is_multiline {
buf.newline();
indent + INDENT
} else {
buf.spaces(1);
indent
};
condition.format(buf, return_indent);
// Always put a blank line after the `expect` line(s)
buf.ensure_ends_with_blank_line();
continuation.format(buf, indent);
}
fn fmt_return<'a>(
buf: &mut Buf,
return_value: &'a Loc<Expr<'a>>,