From 57088312fdd8e602a084bd5736a0e22a34be9ec0 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Tue, 17 Oct 2023 14:40:08 +0200 Subject: worker: move shared code to lib Avoid importing code from worker/lib into lib. It should only be the other way around. Move the message parsing code used by maildir, notmuch, mbox and the eml viewer into a lib/rfc822 package. Adapt imports accordingly. Signed-off-by: Robin Jarry Reviewed-by: Koni Marti Tested-by: Moritz Poldrack Tested-by: Inwit --- worker/mbox/io.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'worker/mbox/io.go') diff --git a/worker/mbox/io.go b/worker/mbox/io.go index 2fe39813..f5fbc596 100644 --- a/worker/mbox/io.go +++ b/worker/mbox/io.go @@ -5,15 +5,15 @@ import ( "io" "time" + "git.sr.ht/~rjarry/aerc/lib/rfc822" "git.sr.ht/~rjarry/aerc/models" - "git.sr.ht/~rjarry/aerc/worker/lib" "github.com/emersion/go-mbox" ) -func Read(r io.Reader) ([]lib.RawMessage, error) { +func Read(r io.Reader) ([]rfc822.RawMessage, error) { mbr := mbox.NewReader(r) uid := uint32(0) - messages := make([]lib.RawMessage, 0) + messages := make([]rfc822.RawMessage, 0) for { msg, err := mbr.NextMessage() if errors.Is(err, io.EOF) { -- cgit