Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

format: don't add bad comma inside empty bitarray

+17
+5
compiler-core/src/format.rs
··· 2213 2213 segments: impl IntoIterator<Item = Document<'a>>, 2214 2214 is_simple: bool, 2215 2215 ) -> Document<'a> { 2216 + let mut segments = segments.into_iter().peekable(); 2217 + if segments.peek().is_none() { 2218 + // Avoid adding illegal comma in empty bit array 2219 + return "<<>>".to_doc(); 2220 + } 2216 2221 let comma = if is_simple { 2217 2222 flex_break(",", ", ") 2218 2223 } else {
+12
compiler-core/src/format/tests/bit_array.rs
··· 41 41 ); 42 42 } 43 43 44 + // https://github.com/gleam-lang/gleam/issues/2932 45 + #[test] 46 + fn tight_empty() { 47 + assert_format!( 48 + "fn main() { 49 + let some_really_really_really_really_really_really_really_long_variable_name_to_force_wrapping = <<>> 50 + some_really_really_really_really_really_really_really_long_variable_name_to_force_wrapping 51 + } 52 + " 53 + ); 54 + } 55 + 44 56 #[test] 45 57 fn concise_wrapping_of_simple_bit_arrays() { 46 58 assert_format!(