Revert "update size asserts"

This reverts commit 9973d4b8d2.
This commit is contained in:
Folkert 2023-04-21 12:15:19 +02:00
parent 7af408f58d
commit 394495d307
9 changed files with 14 additions and 52 deletions

View file

@ -377,11 +377,7 @@ fn fmt_expect_fx<'a>(
condition.format(buf, return_indent);
}
pub fn fmt_value_def(
buf: &mut Buf<'_>,
def: &roc_parse::ast::ValueDef<'_>,
indent: u16,
) {
pub fn fmt_value_def(buf: &mut Buf<'_>, def: &roc_parse::ast::ValueDef<'_>, indent: u16) {
def.format(buf, indent);
}
@ -393,12 +389,7 @@ pub fn fmt_defs(buf: &mut Buf<'_>, defs: &Defs<'_>, indent: u16) {
defs.format(buf, indent);
}
pub fn fmt_body<'a>(
buf: &mut Buf<'_>,
pattern: &'a Pattern<'a>,
body: &'a Expr<'a>,
indent: u16,
) {
pub fn fmt_body<'a>(buf: &mut Buf<'_>, pattern: &'a Pattern<'a>, body: &'a Expr<'a>, indent: u16) {
pattern.format_with_options(buf, Parens::InApply, Newlines::No, indent);
buf.indent(indent);
buf.push_str(" =");

View file

@ -4,12 +4,7 @@ use crate::spaces::{fmt_comments_only, fmt_spaces, NewlineAt, INDENT};
use crate::Buf;
use roc_parse::ast::{Base, CommentOrNewline, Pattern, PatternAs};
pub fn fmt_pattern<'a>(
buf: &mut Buf<'_>,
pattern: &'a Pattern<'a>,
indent: u16,
parens: Parens,
) {
pub fn fmt_pattern<'a>(buf: &mut Buf<'_>, pattern: &'a Pattern<'a>, indent: u16, parens: Parens) {
pattern.format_with_options(buf, parens, Newlines::No, indent);
}

View file

@ -21,22 +21,14 @@ use crate::{Ast, Buf};
/// The number of spaces to indent.
pub const INDENT: u16 = 4;
pub fn fmt_default_spaces(
buf: &mut Buf<'_>,
spaces: &[CommentOrNewline<'_>],
indent: u16,
) {
pub fn fmt_default_spaces(buf: &mut Buf<'_>, spaces: &[CommentOrNewline<'_>], indent: u16) {
if spaces.is_empty() {
buf.spaces(1);
} else {
fmt_spaces(buf, spaces.iter(), indent);
}
}
pub fn fmt_default_newline(
buf: &mut Buf<'_>,
spaces: &[CommentOrNewline<'_>],
indent: u16,
) {
pub fn fmt_default_newline(buf: &mut Buf<'_>, spaces: &[CommentOrNewline<'_>], indent: u16) {
if spaces.is_empty() {
buf.newline();
} else {