This commit is contained in:
sxyazi 2025-02-23 23:59:03 +08:00
parent 27bf3207c4
commit adf846319a
No known key found for this signature in database

View file

@ -1,5 +1,6 @@
use std::{borrow::Cow, mem, time::Duration}; use std::{borrow::Cow, mem, time::Duration};
use anyhow::bail;
use tokio::pin; use tokio::pin;
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream}; use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
use tracing::error; use tracing::error;
@ -67,7 +68,7 @@ impl Tab {
subject: opt.subject.into_owned(), subject: opt.subject.into_owned(),
args: opt.args, args: opt.args,
}), }),
SearchOptVia::None => Result::Err(anyhow::anyhow!("Invalid `search` option")), SearchOptVia::None => bail!("Invalid `via` option for `search` command"),
}?; }?;
let rx = UnboundedReceiverStream::new(rx).chunks_timeout(5000, Duration::from_millis(500)); let rx = UnboundedReceiverStream::new(rx).chunks_timeout(5000, Duration::from_millis(500));