Skip to content

Commit

Permalink
fix(deps): update rust crate meilisearch-sdk to 0.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
spotlightishere committed Aug 20, 2024
1 parent 65a2e14 commit 86803d1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 124 deletions.
129 changes: 12 additions & 117 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/search/meilisearch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ charted-config = { version = "0.1.0-beta", path = "../../config" }
charted-search = { version = "0.1.0-beta", path = ".." }
erased-serde.workspace = true
eyre.workspace = true
meilisearch-sdk = "0.25.0"
meilisearch-sdk = "0.27.0"
sentry.workspace = true
serde.workspace = true
tracing.workspace = true
Expand Down
16 changes: 10 additions & 6 deletions crates/search/meilisearch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
use async_trait::async_trait;
use charted_config::search::meilisearch::Config;
use charted_search::{Backend, Indexable};
use meilisearch_sdk::{FailedTask, Task, TaskInfo};
use meilisearch_sdk::{
task_info::TaskInfo,
tasks::{FailedTask, Task},
};
use std::borrow::Cow;
use tracing::{error, info, trace};

Expand All @@ -35,17 +38,18 @@ impl Indexable for DummyIndexable {

/// Represents a [`Backend`] that allows to search through objects with [Meilisearch](https://meilisearch.com).
#[derive(Debug, Clone)]
pub struct Meilisearch(meilisearch_sdk::Client);
pub struct Meilisearch(meilisearch_sdk::client::Client);

impl Meilisearch {
/// Creates a new [`Meilisearch`] object with the [configuration reference][Config]
pub fn new(config: &Config) -> Meilisearch {
let client = meilisearch_sdk::Client::new(&config.host, config.master_key.as_ref());
Meilisearch(client)
let client = meilisearch_sdk::client::Client::new(&config.host, config.master_key.as_ref());
// This should only fail if reqwest fails to create its client internally.
Meilisearch(client.expect("should be able to create Melisearch client"))
}

/// Returns a reference to the constructed Meilisearch SDK client.
pub fn client(&self) -> &meilisearch_sdk::Client {
pub fn client(&self) -> &meilisearch_sdk::client::Client {
&self.0
}

Expand Down Expand Up @@ -104,7 +108,7 @@ impl Backend for Meilisearch {
}

async fn process_task(
client: &meilisearch_sdk::Client,
client: &meilisearch_sdk::client::Client,
task: &TaskInfo,
obj: &(dyn Indexable + Send + Sync),
) -> eyre::Result<()> {
Expand Down

0 comments on commit 86803d1

Please sign in to comment.