~rjarry/aerc-devel

aerc: format: remove unused code v1 APPLIED

Tim Culverhouse: 1
 format: remove unused code

 1 files changed, 0 insertions(+), 27 deletions(-)
#1153057 alpine-edge.yml success
#1153058 openbsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rjarry/aerc-devel/patches/49644/mbox | git am -3
Learn more about email & git

[PATCH aerc] format: remove unused code Export this patch

Remove unused TruncateHead function.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
---
 lib/format/format.go | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/lib/format/format.go b/lib/format/format.go
index 7c2d5f64ca98..a8600009443a 100644
--- a/lib/format/format.go
+++ b/lib/format/format.go
@@ -8,8 +8,6 @@ import (
	"unicode"

	"github.com/emersion/go-message/mail"
	"github.com/mattn/go-runewidth"
	"github.com/rivo/uniseg"
)

// AddressForHumans formats the address. If the address's name
@@ -66,31 +64,6 @@ func CompactPath(name string, sep rune) (compact string) {
	return
}

func TruncateHead(s string, w int, head string) string {
	width := runewidth.StringWidth(s)
	if width <= w {
		return s
	}
	w -= runewidth.StringWidth(head)
	pos := 0
	g := uniseg.NewGraphemes(s)
	for g.Next() {
		var chWidth int
		for _, r := range g.Runes() {
			chWidth = runewidth.RuneWidth(r)
			if chWidth > 0 {
				break
			}
		}
		if width-chWidth <= w {
			pos, _ = g.Positions()
			break
		}
		width -= chWidth
	}
	return head + s[pos:]
}

func DummyIfZeroDate(date time.Time, format string, todayFormat string,
	thisWeekFormat string, thisYearFormat string,
) string {
-- 
2.43.2
aerc/patches: SUCCESS in 2m7s

[format: remove unused code][0] from [Tim Culverhouse][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/49644
[1]: mailto:tim@timculverhouse.com

✓ #1153058 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/1153058
✓ #1153057 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1153057
Tim Culverhouse <tim@timculverhouse.com> wrote: