|
1 | 1 | use async_std::prelude::*;
|
2 | 2 | use async_std::{
|
3 |
| - channel::{bounded as channel, Receiver, Sender}, |
| 3 | + channel::{self, Receiver, Sender}, |
4 | 4 | task,
|
5 | 5 | };
|
6 | 6 |
|
| 7 | +use crate::config::Config; |
7 | 8 | use crate::context::Context;
|
8 | 9 | use crate::dc_tools::maybe_add_time_based_warnings;
|
9 | 10 | use crate::imap::Imap;
|
10 | 11 | use crate::job::{self, Thread};
|
11 |
| -use crate::{config::Config, message::MsgId, smtp::Smtp}; |
| 12 | +use crate::message::MsgId; |
| 13 | +use crate::smtp::Smtp; |
12 | 14 |
|
13 | 15 | pub(crate) struct StopToken;
|
14 | 16 |
|
@@ -277,12 +279,12 @@ impl Scheduler {
|
277 | 279 | let (smtp, smtp_handlers) = SmtpConnectionState::new();
|
278 | 280 | let (inbox, inbox_handlers) = ImapConnectionState::new();
|
279 | 281 |
|
280 |
| - let (inbox_start_send, inbox_start_recv) = channel(1); |
281 |
| - let (mvbox_start_send, mvbox_start_recv) = channel(1); |
| 282 | + let (inbox_start_send, inbox_start_recv) = channel::bounded(1); |
| 283 | + let (mvbox_start_send, mvbox_start_recv) = channel::bounded(1); |
282 | 284 | let mut mvbox_handle = None;
|
283 |
| - let (sentbox_start_send, sentbox_start_recv) = channel(1); |
| 285 | + let (sentbox_start_send, sentbox_start_recv) = channel::bounded(1); |
284 | 286 | let mut sentbox_handle = None;
|
285 |
| - let (smtp_start_send, smtp_start_recv) = channel(1); |
| 287 | + let (smtp_start_send, smtp_start_recv) = channel::bounded(1); |
286 | 288 |
|
287 | 289 | let inbox_handle = {
|
288 | 290 | let ctx = ctx.clone();
|
@@ -503,9 +505,9 @@ pub(crate) struct SmtpConnectionState {
|
503 | 505 |
|
504 | 506 | impl SmtpConnectionState {
|
505 | 507 | fn new() -> (Self, SmtpConnectionHandlers) {
|
506 |
| - let (stop_sender, stop_receiver) = channel(1); |
507 |
| - let (shutdown_sender, shutdown_receiver) = channel(1); |
508 |
| - let (idle_interrupt_sender, idle_interrupt_receiver) = channel(1); |
| 508 | + let (stop_sender, stop_receiver) = channel::bounded(1); |
| 509 | + let (shutdown_sender, shutdown_receiver) = channel::bounded(1); |
| 510 | + let (idle_interrupt_sender, idle_interrupt_receiver) = channel::bounded(1); |
509 | 511 |
|
510 | 512 | let handlers = SmtpConnectionHandlers {
|
511 | 513 | connection: Smtp::new(),
|
@@ -551,9 +553,9 @@ pub(crate) struct ImapConnectionState {
|
551 | 553 | impl ImapConnectionState {
|
552 | 554 | /// Construct a new connection.
|
553 | 555 | fn new() -> (Self, ImapConnectionHandlers) {
|
554 |
| - let (stop_sender, stop_receiver) = channel(1); |
555 |
| - let (shutdown_sender, shutdown_receiver) = channel(1); |
556 |
| - let (idle_interrupt_sender, idle_interrupt_receiver) = channel(1); |
| 556 | + let (stop_sender, stop_receiver) = channel::bounded(1); |
| 557 | + let (shutdown_sender, shutdown_receiver) = channel::bounded(1); |
| 558 | + let (idle_interrupt_sender, idle_interrupt_receiver) = channel::bounded(1); |
557 | 559 |
|
558 | 560 | let handlers = ImapConnectionHandlers {
|
559 | 561 | connection: Imap::new(idle_interrupt_receiver),
|
|
0 commit comments