@@ -332,8 +332,8 @@ pub fn render_palette_swatch(palette: &Palette, full: bool) -> String {
332332 // Background-cell helper: emits `ESC[48;2;R;G;B m` + `width` spaces + RESET.
333333 // On malformed palette hex (a theme-file bug, not a user-facing error)
334334 // we degrade to `width` uncolored spaces so layout stays stable.
335- let push_cell = | out : & mut String , hex : & str , width : usize | {
336- match PaletteRenderer :: hex_to_rgb ( hex) {
335+ let push_cell =
336+ | out : & mut String , hex : & str , width : usize | match PaletteRenderer :: hex_to_rgb ( hex) {
337337 Ok ( ( r, g, b) ) => {
338338 out. push_str ( & format ! ( "\x1b [48;2;{r};{g};{b}m" ) ) ;
339339 for _ in 0 ..width {
@@ -346,8 +346,7 @@ pub fn render_palette_swatch(palette: &Palette, full: bool) -> String {
346346 out. push ( ' ' ) ;
347347 }
348348 }
349- }
350- } ;
349+ } ;
351350
352351 if !full {
353352 let mut out = String :: with_capacity ( 128 ) ;
@@ -398,7 +397,14 @@ pub fn render_palette_swatch(palette: &Palette, full: bool) -> String {
398397 // the next cell. 10 cols also keeps the row aligned 1:1 with
399398 // pairs of the 5-col bg cells above (2 × 5 = 10 per label).
400399 const NAMES : [ & str ; 8 ] = [
401- "rosewater" , "red" , "peach" , "yellow" , "green" , "sky" , "blue" , "mauve" ,
400+ "rosewater" ,
401+ "red" ,
402+ "peach" ,
403+ "yellow" ,
404+ "green" ,
405+ "sky" ,
406+ "blue" ,
407+ "mauve" ,
402408 ] ;
403409 out. push_str ( & fg ( & palette. foreground ) ) ;
404410 for name in NAMES {
@@ -667,7 +673,14 @@ mod tests {
667673 assert_eq ! ( lines. len( ) , 2 , "expected exactly 2 lines, got {lines:?}" ) ;
668674 let labels = lines[ 1 ] ;
669675 for name in [
670- "rosewater" , "red" , "peach" , "yellow" , "green" , "sky" , "blue" , "mauve" ,
676+ "rosewater" ,
677+ "red" ,
678+ "peach" ,
679+ "yellow" ,
680+ "green" ,
681+ "sky" ,
682+ "blue" ,
683+ "mauve" ,
671684 ] {
672685 assert ! (
673686 labels. contains( name) ,
@@ -676,7 +689,14 @@ mod tests {
676689 }
677690 // Names must appear in the locked order.
678691 let positions: Vec < _ > = [
679- "rosewater" , "red" , "peach" , "yellow" , "green" , "sky" , "blue" , "mauve" ,
692+ "rosewater" ,
693+ "red" ,
694+ "peach" ,
695+ "yellow" ,
696+ "green" ,
697+ "sky" ,
698+ "blue" ,
699+ "mauve" ,
680700 ]
681701 . iter ( )
682702 . map ( |n| labels. find ( n) . unwrap_or ( usize:: MAX ) )
@@ -700,4 +720,3 @@ mod tests {
700720 insta:: assert_snapshot!( "palette_swatch_8_named_cells" , stripped) ;
701721 }
702722}
703-
0 commit comments