diff --git a/compiler/fmt/src/module.rs b/compiler/fmt/src/module.rs index 52f6804528..c5ea767c0d 100644 --- a/compiler/fmt/src/module.rs +++ b/compiler/fmt/src/module.rs @@ -184,7 +184,7 @@ fn fmt_typed_ident<'a>(buf: &mut Buf<'a>, entry: &TypedIdent<'a>, indent: u16) { buf.indent(indent); buf.push_str(ident.value); fmt_default_spaces(buf, spaces_before_colon, " ", indent); - buf.push(':'); + buf.push_str(": "); ann.value.format(buf, indent); } SpaceBefore(sub_entry, spaces) => { diff --git a/compiler/fmt/tests/test_fmt.rs b/compiler/fmt/tests/test_fmt.rs index 6adbed8ee3..9e036a0d0f 100644 --- a/compiler/fmt/tests/test_fmt.rs +++ b/compiler/fmt/tests/test_fmt.rs @@ -2620,24 +2620,18 @@ mod test_fmt { #[test] fn single_line_platform() { - // There are many places that there should probably be spaces, e.g.: - // requires { model=>Model, msg=>Msg } { main : Effect {} } - // ^ - // putLine : Str -> Effect {}, - // ^ - // TODO: improve spacing module_formats_same( "platform folkertdev/foo \ - requires { model=>Model, msg=>Msg } { main :Effect {} } \ + requires { model=>Model, msg=>Msg } { main : Effect {} } \ exposes [] \ packages {} \ imports [ Task.{ Task } ] \ provides [ mainForHost ] \ effects fx.Effect \ { \ - putLine :Str -> Effect {}, \ - putInt :I64 -> Effect {}, \ - getInt :Effect { value : I64, errorCode : [ A, B ], isError : Bool } \ + putLine : Str -> Effect {}, \ + putInt : I64 -> Effect {}, \ + getInt : Effect { value : I64, errorCode : [ A, B ], isError : Bool } \ } ", ); }