aboutsummaryrefslogtreecommitdiff
path: root/helix-tui/src/widgets/table.rs
diff options
context:
space:
mode:
authorGokul Soumya2022-12-25 05:54:09 +0000
committerBlaž Hrastnik2023-01-18 05:19:32 +0000
commit5c7db7aed54f52b3af6102517f81c9d70bb6d1fb (patch)
treea49faaa0ceb633c09b908bfe249d2f9b4a935680 /helix-tui/src/widgets/table.rs
parentb2837ff3bea286ce7ccfba9b6fbcd861977caf83 (diff)
Replace menu::Item::{row, label} with format()
Diffstat (limited to 'helix-tui/src/widgets/table.rs')
-rw-r--r--helix-tui/src/widgets/table.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/helix-tui/src/widgets/table.rs b/helix-tui/src/widgets/table.rs
index 2983072d..400f65e0 100644
--- a/helix-tui/src/widgets/table.rs
+++ b/helix-tui/src/widgets/table.rs
@@ -127,6 +127,12 @@ impl<'a> Row<'a> {
}
}
+impl<'a, T: Into<Cell<'a>>> From<T> for Row<'a> {
+ fn from(cell: T) -> Self {
+ Row::new(vec![cell.into()])
+ }
+}
+
/// A widget to display data in formatted columns.
///
/// It is a collection of [`Row`]s, themselves composed of [`Cell`]s: