chore: fix clippy

This commit is contained in:
nathan 2024-06-17 22:08:02 +08:00
parent 5bc39729a7
commit f0a32330b2
3 changed files with 3 additions and 3 deletions

View File

@ -16,5 +16,5 @@ async fn embedding_test() {
};
let result = client.embeddings(request).await.unwrap();
assert!(result.total_tokens > 0);
assert!(result.data.len() > 0);
assert!(!result.data.is_empty());
}

View File

@ -58,7 +58,7 @@ fn push_deltas_to_str(buf: &mut String, deltas: Vec<TextDelta>) {
if let TextDelta::Inserted(text, _) = delta {
let trimmed = text.trim();
if !trimmed.is_empty() {
buf.push_str(&trimmed);
buf.push_str(trimmed);
buf.push(' ');
}
}

View File

@ -49,7 +49,7 @@ impl DocumentWatcher {
fn index_initial_content(document: &mut Document, notifier: &Sender<u64>) -> Result<()> {
let data = document.get_document_data()?;
if let Some(_) = data.meta.text_map.as_ref() {
if data.meta.text_map.as_ref().is_some() {
notifier.send_modify(|i| *i += 1);
}
Ok(())