From 1ff860e0a87f4e7cebef5144e3d470bdb9591402 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Thu, 13 Jun 2024 17:47:44 +0200 Subject: [PATCH] Fixes for Rust v1.79 --- dump/src/reader/v3/settings.rs | 1 + dump/src/reader/v4/settings.rs | 1 + dump/src/reader/v5/tasks.rs | 1 + milli/Cargo.toml | 4 ++-- milli/src/search/new/logger/visual.rs | 11 ++++------- milli/src/update/index_documents/transform.rs | 4 +--- xtask/Cargo.toml | 2 +- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dump/src/reader/v3/settings.rs b/dump/src/reader/v3/settings.rs index 0027bf4ff..3288bb1e7 100644 --- a/dump/src/reader/v3/settings.rs +++ b/dump/src/reader/v3/settings.rs @@ -152,6 +152,7 @@ impl Settings { } #[derive(Debug, Clone, Deserialize)] +#[allow(dead_code)] // otherwise rustc complains that the fields go unused #[cfg_attr(test, derive(serde::Serialize))] #[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] diff --git a/dump/src/reader/v4/settings.rs b/dump/src/reader/v4/settings.rs index 964cd1152..78d9118ff 100644 --- a/dump/src/reader/v4/settings.rs +++ b/dump/src/reader/v4/settings.rs @@ -182,6 +182,7 @@ impl Settings { } } +#[allow(dead_code)] // otherwise rustc complains that the fields go unused #[derive(Debug, Clone, Deserialize)] #[cfg_attr(test, derive(serde::Serialize))] #[serde(deny_unknown_fields)] diff --git a/dump/src/reader/v5/tasks.rs b/dump/src/reader/v5/tasks.rs index 528a870fc..8dfb2d0b0 100644 --- a/dump/src/reader/v5/tasks.rs +++ b/dump/src/reader/v5/tasks.rs @@ -200,6 +200,7 @@ impl std::ops::Deref for IndexUid { } } +#[allow(dead_code)] // otherwise rustc complains that the fields go unused #[derive(Debug)] #[cfg_attr(test, derive(serde::Serialize))] #[cfg_attr(test, serde(rename_all = "camelCase"))] diff --git a/milli/Cargo.toml b/milli/Cargo.toml index 082cd0812..227c27821 100644 --- a/milli/Cargo.toml +++ b/milli/Cargo.toml @@ -74,10 +74,10 @@ csv = "1.3.0" candle-core = { version = "0.4.1" } candle-transformers = { version = "0.4.1" } candle-nn = { version = "0.4.1" } -tokenizers = { git = "https://github.com/huggingface/tokenizers.git", tag = "v0.15.2", version = "0.15.2", default_features = false, features = [ +tokenizers = { git = "https://github.com/huggingface/tokenizers.git", tag = "v0.15.2", version = "0.15.2", default-features = false, features = [ "onig", ] } -hf-hub = { git = "https://github.com/dureuill/hf-hub.git", branch = "rust_tls", default_features = false, features = [ +hf-hub = { git = "https://github.com/dureuill/hf-hub.git", branch = "rust_tls", default-features = false, features = [ "online", ] } tiktoken-rs = "0.5.8" diff --git a/milli/src/search/new/logger/visual.rs b/milli/src/search/new/logger/visual.rs index 8df56da89..2bffdd8d9 100644 --- a/milli/src/search/new/logger/visual.rs +++ b/milli/src/search/new/logger/visual.rs @@ -22,7 +22,7 @@ pub enum SearchEvents { RankingRuleStartIteration { ranking_rule_idx: usize, universe_len: u64 }, RankingRuleNextBucket { ranking_rule_idx: usize, universe_len: u64, bucket_len: u64 }, RankingRuleSkipBucket { ranking_rule_idx: usize, bucket_len: u64 }, - RankingRuleEndIteration { ranking_rule_idx: usize, universe_len: u64 }, + RankingRuleEndIteration { ranking_rule_idx: usize }, ExtendResults { new: Vec }, ProximityGraph { graph: RankingRuleGraph }, ProximityPaths { paths: Vec>> }, @@ -123,12 +123,9 @@ impl SearchLogger for VisualSearchLogger { &mut self, ranking_rule_idx: usize, _ranking_rule: &dyn RankingRule, - universe: &RoaringBitmap, + _universe: &RoaringBitmap, ) { - self.events.push(SearchEvents::RankingRuleEndIteration { - ranking_rule_idx, - universe_len: universe.len(), - }); + self.events.push(SearchEvents::RankingRuleEndIteration { ranking_rule_idx }); self.location.pop(); } fn add_to_results(&mut self, docids: &[u32]) { @@ -326,7 +323,7 @@ impl<'ctx> DetailedLoggerFinish<'ctx> { assert!(ranking_rule_idx == self.rr_action_counter.len() - 1); self.write_skip_bucket(bucket_len)?; } - SearchEvents::RankingRuleEndIteration { ranking_rule_idx, universe_len: _ } => { + SearchEvents::RankingRuleEndIteration { ranking_rule_idx } => { assert!(ranking_rule_idx == self.rr_action_counter.len() - 1); self.write_end_iteration()?; } diff --git a/milli/src/update/index_documents/transform.rs b/milli/src/update/index_documents/transform.rs index 8a3463e6f..b89de35ca 100644 --- a/milli/src/update/index_documents/transform.rs +++ b/milli/src/update/index_documents/transform.rs @@ -48,7 +48,6 @@ pub struct Transform<'a, 'i> { fields_ids_map: FieldsIdsMap, indexer_settings: &'a IndexerConfig, - pub autogenerate_docids: bool, pub index_documents_method: IndexDocumentsMethod, available_documents_ids: AvailableDocumentsIds, @@ -102,7 +101,7 @@ impl<'a, 'i> Transform<'a, 'i> { index: &'i Index, indexer_settings: &'a IndexerConfig, index_documents_method: IndexDocumentsMethod, - autogenerate_docids: bool, + _autogenerate_docids: bool, ) -> Result { // We must choose the appropriate merge function for when two or more documents // with the same user id must be merged or fully replaced in the same batch. @@ -136,7 +135,6 @@ impl<'a, 'i> Transform<'a, 'i> { index, fields_ids_map: index.fields_ids_map(wtxn)?, indexer_settings, - autogenerate_docids, available_documents_ids: AvailableDocumentsIds::from_documents_ids(&documents_ids), original_sorter, flattened_sorter, diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 562dfddb3..a618b06a5 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -21,7 +21,7 @@ reqwest = { version = "0.11.23", features = [ "stream", "json", "rustls-tls", -], default_features = false } +], default-features = false } serde = { version = "1.0.195", features = ["derive"] } serde_json = "1.0.111" sha2 = "0.10.8"