Repository: Nukesor/comfy-table
Pull request #97 (2022-12-30 18:25:52)

New preset "ASCII_FULL_CONDENSED"
**New preset**:
I really should have submitted this alongside the preset added in #94 ... 😅 

Here's the ASCII equivalent of the previously introduced `UTF8_FULL_CONDENSED`; as before, it matches its corresponding `FULL` variant, just without the row dividers:

```python
# ASCII_FULL:          ASCII_FULL_CONDENSED:
# +-------+-------+    +-------+-------+
# | Hello | there |    | Hello | there |
# +===============+    +===============+
# | a     | b     |    | a     | b     |
# |-------+-------|    | c     | d     |
# | c     | d     |    | e     | f     |
# |-------+-------|    +-------+-------+
# | e     | f     |
# +-------+-------+
```

**Also**:
Fixed two lines in `utils/arrangement/mod.rs` that triggered the new `iter_kv_map` [clippy lint](https://github.com/rust-lang/rust-clippy/pull/9409):
```rust
// before
infos.into_iter().map(|(_, info)| info).collect()

// after
infos.into_values().collect()
```

Thanks!


Patch:
diff --git a/src/style/presets.rs b/src/style/presets.rs
index ceec2da..17620fd 100644
--- a/src/style/presets.rs
+++ b/src/style/presets.rs
@@ -11,7 +11,18 @@
 /// ```
 pub const ASCII_FULL: &str = "||--+==+|-+||++++++";
 
-/// Default style without any borders.
+/// Just like ASCII_FULL, but without dividers between rows.
+///
+/// ```text
+/// +-------+-------+
+/// | Hello | there |
+/// +===============+
+/// | a     | b     |
+/// | c     | d     |
+/// +-------+-------+
+pub const ASCII_FULL_CONDENSED: &str = "||--+==+|    ++++++";
+
+/// Just like ASCII_FULL, but without any borders.
 ///
 /// ```text
 ///  Hello | there
@@ -84,7 +95,7 @@ pub const ASCII_MARKDOWN: &str = "||  |-|||           ";
 /// ```
 pub const UTF8_FULL: &str = "││──╞═╪╡┆╌┼├┤┬┴┌┐└┘";
 
-/// Default UTF8 style, but without spacing between rows.
+/// Default UTF8 style, but without dividers between rows.
 ///
 /// ```text
 /// ┌───────┬───────┐
diff --git a/src/utils/arrangement/mod.rs b/src/utils/arrangement/mod.rs
index 772e349..1a81af3 100644
--- a/src/utils/arrangement/mod.rs
+++ b/src/utils/arrangement/mod.rs
@@ -42,7 +42,7 @@ pub fn arrange_content(table: &Table) -> Vec<ColumnDisplayInfo> {
         table_width
     } else {
         disabled::arrange(table, &mut infos, visible_columns, &max_content_widths);
-        return infos.into_iter().map(|(_, info)| info).collect();
+        return infos.into_values().collect();
     };
 
     match &table.arrangement {
@@ -54,7 +54,7 @@ pub fn arrange_content(table: &Table) -> Vec<ColumnDisplayInfo> {
         }
     }
 
-    infos.into_iter().map(|(_, info)| info).collect()
+    infos.into_values().collect()
 }
 
 #[cfg(test)]


Test patch:
diff --git a/tests/all/presets_test.rs b/tests/all/presets_test.rs
index 2baa22f..803ac45 100644
--- a/tests/all/presets_test.rs
+++ b/tests/all/presets_test.rs
@@ -30,6 +30,22 @@ fn test_ascii_full() {
     assert_eq!("\n".to_string() + &table.to_string(), expected);
 }
 
+#[test]
+fn test_ascii_full_condensed() {
+    let mut table = get_preset_table();
+    table.load_preset(ASCII_FULL_CONDENSED);
+    println!("{table}");
+    let expected = "
++-------+-------+
+| Hello | there |
++===============+
+| a     | b     |
+| c     | d     |
++-------+-------+";
+    println!("{expected}");
+    assert_eq!("\n".to_string() + &table.trim_fmt(), expected);
+}
+
 #[test]
 fn test_ascii_no_borders() {
     let mut table = get_preset_table();
@@ -127,7 +143,7 @@ fn test_utf8_full() {
 }
 
 #[test]
-fn test_utf8_condensed() {
+fn test_utf8_full_condensed() {
     let mut table = get_preset_table();
     table.load_preset(UTF8_FULL_CONDENSED);
     println!("{table}");