Commit
Author: Kevin Schoon [me@kevinschoon.com]
Hash: 22773df30bf22a1c935ba76737c66dd8d63bfa8e
Timestamp: Mon, 19 Aug 2024 20:31:29 +0000 (4 months ago)

+6 -8 +/-2 browse
rm double arc
1diff --git a/maitred/src/server.rs b/maitred/src/server.rs
2index d6cff2b..f99f9dd 100644
3--- a/maitred/src/server.rs
4+++ b/maitred/src/server.rs
5 @@ -70,8 +70,8 @@ where
6 address: String,
7 global_timeout: Duration,
8 options: Option<Rc<crate::session::Options>>,
9- milter: Option<Arc<M>>,
10- delivery: Option<Arc<D>>,
11+ milter: Option<M>,
12+ delivery: Option<D>,
13 n_threads: usize,
14 shutdown_handles: Vec<Sender<bool>>,
15 }
16 @@ -123,13 +123,13 @@ where
17
18 /// Process each message with the provided milter before it is delivered
19 pub fn with_milter(mut self, milter: M) -> Self {
20- self.milter = Some(Arc::new(milter));
21+ self.milter = Some(milter);
22 self
23 }
24
25 /// Delivery handles the delivery of the final message
26 pub fn with_delivery(mut self, delivery: D) -> Self {
27- self.delivery = Some(Arc::new(delivery));
28+ self.delivery = Some(delivery);
29 self
30 }
31
32 diff --git a/maitred/src/worker.rs b/maitred/src/worker.rs
33index d5160fd..d91dee2 100644
34--- a/maitred/src/worker.rs
35+++ b/maitred/src/worker.rs
36 @@ -3,10 +3,8 @@ use std::{iter, time::Duration};
37
38 use crossbeam_deque::{Injector, Stealer, Worker as WorkQueue};
39 use email_address::EmailAddress;
40- use futures::StreamExt;
41 use mail_parser::Message;
42 use tokio::sync::{mpsc::Receiver, Mutex};
43- use tokio_stream::{self as stream};
44 use url::Host;
45
46 use crate::{Delivery, Error, Milter, Session};
47 @@ -43,8 +41,8 @@ where
48 D: Delivery + Clone + Send + Sync,
49 M: Milter + Clone + Send + Sync,
50 {
51- pub milter: Arc<M>,
52- pub delivery: Arc<D>,
53+ pub milter: M,
54+ pub delivery: D,
55 pub global_queue: Arc<Injector<Packet>>,
56 pub stealers: Vec<Stealer<Packet>>,
57 pub local_queue: Arc<Mutex<WorkQueue<Packet>>>,