Private
Public Access
1
0

fix all warnings

This commit is contained in:
2025-06-16 19:25:24 -07:00
parent 9d591dffc5
commit 75fe4d4608
8 changed files with 18 additions and 110 deletions

View File

@@ -6,7 +6,7 @@ use uuid::Uuid;
pub use crate::APIInterface;
use crate::{
api::event_socket::{EventSocket, SinkMessage},
api::event_socket::{EventSocket, SinkMessage, SocketEvent, SocketUpdate},
api::http_client::Credentials,
model::{
Conversation, ConversationID, Event, JwtToken, Message, MessageID, OutgoingMessage,
@@ -16,6 +16,7 @@ use crate::{
use bytes::Bytes;
use futures_util::stream::BoxStream;
use futures_util::Sink;
use futures_util::StreamExt;
pub struct TestClient {
@@ -52,21 +53,20 @@ impl TestEventSocket {
#[async_trait]
impl EventSocket for TestEventSocket {
type Error = TestError;
type EventStream = BoxStream<'static, Result<Event, TestError>>;
type UpdateStream = BoxStream<'static, Result<Vec<UpdateItem>, TestError>>;
type EventStream = BoxStream<'static, Result<SocketEvent, TestError>>;
type UpdateStream = BoxStream<'static, Result<SocketUpdate, TestError>>;
async fn events(self) -> Self::EventStream {
futures_util::stream::iter(self.events.into_iter().map(Ok)).boxed()
async fn events(self) -> (Self::EventStream, impl Sink<SinkMessage, Error = Self::Error>) {
(
futures_util::stream::iter(self.events.into_iter().map(Ok)).boxed(),
futures_util::sink::sink(),
)
}
async fn raw_updates(self) -> Self::UpdateStream {
let results: Vec<Result<Vec<UpdateItem>, TestError>> = vec![];
futures_util::stream::iter(results.into_iter()).boxed()
}
fn get_sink(&mut self) -> impl futures_util::Sink<SinkMessage> {
todo!("")
}
}
#[async_trait]
@@ -126,7 +126,7 @@ impl APIInterface for TestClient {
async fn fetch_attachment_data(
&mut self,
guid: &String,
guid: &str,
preview: bool,
) -> Result<Self::ResponseStream, Self::Error> {
Ok(futures_util::stream::iter(vec![Ok(Bytes::from_static(b"test"))]).boxed())