melib: add Envelope::recipient_any method
Cargo manifest lints / Lint Cargo manifests on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Has been cancelled
Details
Run cargo lints / Lint on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Has been cancelled
Details
Run Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 7m23s
Details
Cargo manifest lints / Lint Cargo manifests on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Has been cancelled
Details
Run cargo lints / Lint on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Has been cancelled
Details
Run Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 7m23s
Details
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
parent
e86610f345
commit
034e4ac403
|
@ -859,6 +859,15 @@ impl Envelope {
|
|||
pub fn tags_mut(&mut self) -> &mut IndexSet<TagHash> {
|
||||
&mut self.tags
|
||||
}
|
||||
|
||||
/// Returns `true` if `is_recipient` address is included in To:, Cc: or Bcc: headers.
|
||||
pub fn recipient_any(&self, is_recipient: &Address) -> bool {
|
||||
self.to()
|
||||
.iter()
|
||||
.chain(self.cc().iter())
|
||||
.chain(self.bcc().iter())
|
||||
.any(|a| a == is_recipient)
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for Envelope {}
|
||||
|
|
Loading…
Reference in New Issue