summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/MaildirIndexer/Parser.pm68
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/MaildirIndexer/Parser.pm6 b/lib/MaildirIndexer/Parser.pm6
index 1aa658b..420d4c3 100644
--- a/lib/MaildirIndexer/Parser.pm6
+++ b/lib/MaildirIndexer/Parser.pm6
@@ -69,14 +69,16 @@ multi parse-email(IO::Path:D $p --> MaildirIndexer::Email) is export {
multi parse-email(IO::Path:D $p, :$headers-only! --> MaildirIndexer::Email) is export {
my MaildirIndexer::Email $result;
MaildirIndexer::LogTimelineSchema::Parse::Email::File.log: :file($p.path), -> {
- $result = parse-email(
- $p.lines(
+ my IO::Handle $h = $p.open(
:enc<utf8-c8>,
:nl-in(@separators),
:!chomp,
- )[0],
+ );
+ $result = parse-email(
+ $h.lines()[0],
path => $p,
);
+ $h.close();
}
return $result;
}