diff options
author | dakkar <dakkar@thenautilus.net> | 2019-12-31 15:15:43 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2019-12-31 15:15:43 +0000 |
commit | 178fa2accbad112807b50d937cb945f5266f2d09 (patch) | |
tree | 9ceeb85c1eb90a7285dc2064af22dae0f468c873 /lib/MaildirIndexer | |
parent | better fix for the array type check (diff) | |
download | MaildirIndexer-178fa2accbad112807b50d937cb945f5266f2d09.tar.gz MaildirIndexer-178fa2accbad112807b50d937cb945f5266f2d09.tar.bz2 MaildirIndexer-178fa2accbad112807b50d937cb945f5266f2d09.zip |
I don't understand this context/flat thing
Diffstat (limited to 'lib/MaildirIndexer')
-rw-r--r-- | lib/MaildirIndexer/Index/ByAddresses.rakumod | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/MaildirIndexer/Index/ByAddresses.rakumod b/lib/MaildirIndexer/Index/ByAddresses.rakumod index d9fd945..507c0e7 100644 --- a/lib/MaildirIndexer/Index/ByAddresses.rakumod +++ b/lib/MaildirIndexer/Index/ByAddresses.rakumod @@ -46,9 +46,12 @@ method add-mail(MaildirIndexer::Email:D $email, Str:D $mailbox --> Nil) { method del-path(IO:D $file, Str:D $mailbox --> Nil) { MaildirIndexer::LogTimelineSchema::Index::Rm.log: :class('ByAddresses'),:$mailbox, -> { - my Str (@addresses,) = %!addresses-for-file{$file.path}:delete or return; + # using `Str @addresses` fails when the path isn't present in + # the hash, because it tries to assign the (undefined) + # Array[Str] as a single element, instead of splatting it + my Array[Str] $addresses = %!addresses-for-file{$file.path}:delete or return; - self.account-for(@addresses,$mailbox,-1); + self.account-for($addresses,$mailbox,-1); return; } |