jonhoo / rust-imap

IMAP client library for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Removing lifetime parameter from imap::types::Flag?

TornaxO7 opened this issue · comments

Hello!

I'm helping in writing a mail-cli program and for that I need to store some mails in the memory for better performance (for example, if you want to read mail1 and then mail2 quickly). This also means, that I want to store the flags of the mails as well but it's not really possible to store the output of imap::types::Fetch::flags() due to the lifetime-parameter so I'm wondering if it's planned to remove it.

Otherwise I think that I'll write an extra-enum which represents your Flag-enum but it uses Custom(String) instead to make it "independent" from the lifetime or do you have any other suggestions how I could avoid/fix this problem?

#206 is exactly how I was going to propose we fix this :)

I think that I should close this, right?

Ah, yes, in the latest 3.0.0 alpha we do have Flag::into_owned now!