chore: clippy

This commit is contained in:
Nathan 2025-03-30 20:53:27 +08:00
parent b63c4dfe21
commit e3a0806eee
4 changed files with 6 additions and 18 deletions

View File

@ -139,7 +139,6 @@ impl AIManager {
chat_id.to_string(),
self.user_service.clone(),
self.cloud_service_wm.clone(),
self.store_preferences.clone(),
))
});
if self.local_ai.is_running() {
@ -235,7 +234,6 @@ impl AIManager {
chat_id.to_string(),
self.user_service.clone(),
self.cloud_service_wm.clone(),
self.store_preferences.clone(),
));
self.chats.insert(chat_id.to_string(), chat.clone());
Ok(chat)
@ -495,7 +493,6 @@ impl AIManager {
chat_id.to_string(),
self.user_service.clone(),
self.cloud_service_wm.clone(),
self.store_preferences.clone(),
));
self.chats.insert(chat_id.to_string(), chat.clone());
Ok(chat)

View File

@ -15,7 +15,6 @@ use flowy_ai_pub::cloud::{
AIModel, ChatCloudService, ChatMessage, MessageCursor, QuestionStreamValue, ResponseFormat,
};
use flowy_error::{ErrorCode, FlowyError, FlowyResult};
use flowy_sqlite::kv::KVStorePreferences;
use flowy_sqlite::DBConnection;
use futures::{SinkExt, StreamExt};
use lib_infra::isolate_stream::IsolateSink;
@ -40,7 +39,6 @@ pub struct Chat {
latest_message_id: Arc<AtomicI64>,
stop_stream: Arc<AtomicBool>,
stream_buffer: Arc<Mutex<StringBuffer>>,
store_preferences: Arc<KVStorePreferences>,
}
impl Chat {
@ -49,7 +47,6 @@ impl Chat {
chat_id: String,
user_service: Arc<dyn AIUserService>,
chat_service: Arc<AICloudServiceMiddleware>,
store_preferences: Arc<KVStorePreferences>,
) -> Chat {
Chat {
uid,
@ -60,7 +57,6 @@ impl Chat {
latest_message_id: Default::default(),
stop_stream: Arc::new(AtomicBool::new(false)),
stream_buffer: Arc::new(Mutex::new(StringBuffer::default())),
store_preferences,
}
}

View File

@ -13,7 +13,6 @@ use futures::{SinkExt, StreamExt};
use lib_infra::isolate_stream::IsolateSink;
use crate::stream_message::StreamMessage;
use flowy_sqlite::kv::KVStorePreferences;
use std::sync::{Arc, Weak};
use tokio::select;
use tracing::info;

View File

@ -180,13 +180,11 @@ impl ChatCloudService for AICloudServiceMiddleware {
Ok(stream::once(async { Err(FlowyError::local_ai_unavailable()) }).boxed())
},
}
} else {
if self.local_ai.is_enabled() {
} else if self.local_ai.is_enabled() {
Err(FlowyError::local_ai_not_ready())
} else {
Err(FlowyError::local_ai_disabled())
}
}
} else {
self
.cloud_service
@ -316,13 +314,11 @@ impl ChatCloudService for AICloudServiceMiddleware {
Ok(stream::once(async { Err(FlowyError::local_ai_unavailable()) }).boxed())
},
}
} else {
if self.local_ai.is_enabled() {
} else if self.local_ai.is_enabled() {
Err(FlowyError::local_ai_not_ready())
} else {
Err(FlowyError::local_ai_disabled())
}
}
} else {
self
.cloud_service