From e3cb19b4516cd227ff09e4acdc4dfba8889342ed Mon Sep 17 00:00:00 2001 From: InAnYan Date: Fri, 8 Nov 2024 22:11:18 +0200 Subject: [PATCH 1/3] Fix assistant from merge --- module/move/assistant/src/bin/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/move/assistant/src/bin/main.rs b/module/move/assistant/src/bin/main.rs index 69843c1ed4..419030d03b 100644 --- a/module/move/assistant/src/bin/main.rs +++ b/module/move/assistant/src/bin/main.rs @@ -14,7 +14,7 @@ use clap::Parser; use assistant:: { - client, + client::client, commands::{ Cli, CliCommand, self }, Secret }; From 900067871c9b5776e6c8739a31eaefbfc400adef Mon Sep 17 00:00:00 2001 From: InAnYan Date: Mon, 11 Nov 2024 10:17:20 +0200 Subject: [PATCH 2/3] Log `format_tools` variables --- module/core/format_tools/src/format/output_format/table.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/core/format_tools/src/format/output_format/table.rs b/module/core/format_tools/src/format/output_format/table.rs index 579ba6c783..b829c0afe6 100644 --- a/module/core/format_tools/src/format/output_format/table.rs +++ b/module/core/format_tools/src/format/output_format/table.rs @@ -247,7 +247,7 @@ impl TableOutputFormat for Table write!( c.buf, "{}", cell_prefix )?; - // println!( "icol : {icol} | irow : {irow} | width : {width} | cell_width : {cell_width}" ); + println!( "icol : {icol} | irow : {irow} | width : {width} | cell_width : {cell_width} | slice.len() : {}", slice.len() ); let lspaces = ( width - cell_width ) / 2; let rspaces = ( width - cell_width + 1 ) / 2 + cell_width - slice.len(); // println!( "icol : {icol} | irow : {irow} | width : {width} | cell_width : {cell_width} | lspaces : {lspaces} | rspaces : {rspaces}" ); From ea27a1f0ab83fe63f627c13bf4e707d6c6c48d3a Mon Sep 17 00:00:00 2001 From: InAnYan Date: Mon, 11 Nov 2024 10:37:02 +0200 Subject: [PATCH 3/3] Possible fix to `format_tools` --- .../src/format/output_format/table.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/module/core/format_tools/src/format/output_format/table.rs b/module/core/format_tools/src/format/output_format/table.rs index b829c0afe6..e96af36f20 100644 --- a/module/core/format_tools/src/format/output_format/table.rs +++ b/module/core/format_tools/src/format/output_format/table.rs @@ -248,8 +248,19 @@ impl TableOutputFormat for Table write!( c.buf, "{}", cell_prefix )?; println!( "icol : {icol} | irow : {irow} | width : {width} | cell_width : {cell_width} | slice.len() : {}", slice.len() ); - let lspaces = ( width - cell_width ) / 2; - let rspaces = ( width - cell_width + 1 ) / 2 + cell_width - slice.len(); + + let lspaces = if cell_width > width { + 0 + } else { + ( width - cell_width ) / 2 + }; + + let rspaces = if (cell_width > width) || (slice.len() > cell_width) { + 0 + } else { + ( width - cell_width + 1 ) / 2 + cell_width - slice.len() + }; + // println!( "icol : {icol} | irow : {irow} | width : {width} | cell_width : {cell_width} | lspaces : {lspaces} | rspaces : {rspaces}" ); if lspaces > 0