File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 9898 - aarch64-apple-darwin
9999 include :
100100 - target : x86_64-unknown-linux-gnu
101- runner : ubuntu-20 .04
101+ runner : ubuntu-22 .04
102102 - target : aarch64-apple-darwin
103103 runner : macos-14
104104
Original file line number Diff line number Diff line change 11# Release notes
22
3+ ## 0.5.0 (not yet released)
4+
5+ * Highlights:*
6+
7+ ** Row** 0.5 improves the user interface and updates the code to meet modern
8+ Rust standards.
9+
10+ The subcommands ` show directories ` , ` show jobs ` , and ` show status ` now report
11+ ` No matches. ` when there are no results to show.
12+
13+ * Changed:*
14+
15+ * Writing tabular output with no rows now results in the output ` No matches. ` .
16+ * Build executables on Ubuntu 22.04.
17+
318## 0.4.0 (2024-12-06)
419
520* Highlights:*
Original file line number Diff line number Diff line change @@ -70,25 +70,29 @@ impl<T: Write> Drop for MultiProgressWriter<T> {
7070 }
7171}
7272
73+ #[ derive( Clone , Debug , PartialEq ) ]
7374pub ( crate ) enum Alignment {
7475 Left ,
7576 Right ,
7677}
7778
7879/// One item in a table.
80+ #[ derive( Clone , Debug , PartialEq ) ]
7981pub ( crate ) struct Item {
8082 text : String ,
8183 style : Style ,
8284 alignment : Alignment ,
8385}
8486
8587/// A table row is either a separator or a vector of items.
88+ #[ derive( Clone , Debug , PartialEq ) ]
8689pub ( crate ) enum Row {
8790 Separator ,
8891 Items ( Vec < Item > ) ,
8992}
9093
9194/// The table
95+ #[ derive( Clone , Debug , PartialEq ) ]
9296pub ( crate ) struct Table {
9397 // The header row.
9498 pub header : Vec < Item > ,
@@ -154,6 +158,11 @@ impl Table {
154158 }
155159
156160 pub ( crate ) fn write < W : Write > ( & self , writer : & mut W ) -> io:: Result < ( ) > {
161+ if self . rows . is_empty ( ) || self . rows . len ( ) == 1 && self . rows [ 0 ] == Row :: Separator {
162+ writeln ! ( writer, "No matches." ) ?;
163+ return Ok ( ( ) ) ;
164+ }
165+
157166 let mut column_width: Vec < usize > = self
158167 . header
159168 . iter ( )
You can’t perform that action at this time.
0 commit comments