Skip to content

Commit

Permalink
fmt & clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
allevo committed Nov 19, 2024
1 parent 353d41b commit 596315f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/bin/embeddings/pq_bench.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use anyhow::Result;
use csv::ReaderBuilder;
use fastembed::Embedding;
use rustorama::embeddings::pq;
use rustorama::embeddings::OramaModels;
use fastembed::Embedding;
use serde::Deserialize;
use std::time::Instant;

Expand Down
4 changes: 2 additions & 2 deletions src/bin/vector_index_test.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use anyhow::Result;
use rustorama::embeddings::OramaModels;
use rustorama::indexes::vector::{VectorIndex, VectorIndexConfig};
use rustorama::types::DocumentId;
use serde::Deserialize;
use std::fs;
use std::time::Instant;
use rustorama::types::DocumentId;
use rustorama::indexes::vector::{VectorIndex, VectorIndexConfig};

#[derive(Deserialize, Debug)]
struct Movie {
Expand Down
2 changes: 1 addition & 1 deletion src/embeddings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ pub mod custom_models;
pub mod pq;
pub mod properties_selector;

use custom_models::{CustomModel, ModelFileConfig};
use anyhow::{anyhow, Context, Result};
use custom_models::{CustomModel, ModelFileConfig};
use fastembed::{EmbeddingModel, InitOptions, InitOptionsUserDefined, TextEmbedding};
use once_cell::sync::OnceCell;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion src/indexes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pub mod bool;
pub mod code;
pub mod number;
pub mod string;
pub mod vector;
pub mod vector;
2 changes: 1 addition & 1 deletion src/indexes/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl StringIndex {
.map(|(key, value)| {
(
key.clone(),
((value.posting_list_id.0 as u64) << 32) | (value.term_frequency as u64),
(value.posting_list_id.0 << 32) | (value.term_frequency as u64),
)
})
.collect()
Expand Down
2 changes: 1 addition & 1 deletion src/indexes/vector.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use crate::embeddings::OramaModels;
use anyhow::Result;
use hora::core::ann_index::ANNIndex;
use hora::core::metrics::Metric::Manhattan;
use hora::core::node::IdxType;
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ pub mod document_storage;

pub mod web_server;

pub mod embeddings;
pub mod embeddings;
13 changes: 9 additions & 4 deletions tanstack_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ use std::{fs, sync::Arc};

use documentation::parse_documentation;
use example::parse_example;
use rustorama::{collection_manager::{dto::{CreateCollectionOptionDTO, Limit, SearchParams, TypedField}, CollectionManager, CollectionsConfiguration}, types::CodeLanguage, web_server::{HttpConfig, WebServer}};


use rustorama::{
collection_manager::{
dto::{CreateCollectionOptionDTO, Limit, SearchParams, TypedField},
CollectionManager, CollectionsConfiguration,
},
types::CodeLanguage,
web_server::{HttpConfig, WebServer},
};

mod documentation;
mod example;
Expand All @@ -15,7 +20,7 @@ async fn main() -> anyhow::Result<()> {
let storage_dir = "./tanstack";
let _ = fs::remove_dir_all(storage_dir);

let manager = CollectionManager::new(CollectionsConfiguration { });
let manager = CollectionManager::new(CollectionsConfiguration {});

let collection_id = manager
.create_collection(CreateCollectionOptionDTO {
Expand Down

0 comments on commit 596315f

Please sign in to comment.