Fix some of the edition 2024 warnings

This commit is contained in:
Clément Renault 2025-04-01 12:21:33 +02:00
parent 2762d5a32a
commit aa87064a13
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F
82 changed files with 323 additions and 317 deletions

View file

@ -8,7 +8,7 @@ use Criterion::*;
use crate::search::{self, EXTERNAL_DOCUMENTS_IDS};
macro_rules! test_distinct {
($func:ident, $distinct:ident, $exhaustive:ident, $limit:expr, $offset:expr, $criteria:expr, $n_res:expr) => {
($func:ident, $distinct:ident, $exhaustive:ident, $limit:expr, $offset:expr_2021, $criteria:expr_2021, $n_res:expr_2021) => {
#[test]
fn $func() {
let criteria = $criteria;

View file

@ -5,7 +5,7 @@ use Criterion::*;
use crate::search::{self, EXTERNAL_DOCUMENTS_IDS};
macro_rules! test_filter {
($func:ident, $filter:expr) => {
($func:ident, $filter:expr_2021) => {
#[test]
fn $func() {
let criteria = vec![Words, Typo, Proximity, Attribute, Exactness];

View file

@ -220,11 +220,11 @@ fn execute_filter(filter: &str, document: &TestDocument) -> Option<String> {
id = Some(document.id.clone())
}
} else if let Some(("asc_desc_rank", filter)) = filter.split_once('<') {
if document.asc_desc_rank < filter.parse().unwrap() {
if document.asc_desc_rank < filter.parse::<u32>().unwrap() {
id = Some(document.id.clone())
}
} else if let Some(("asc_desc_rank", filter)) = filter.split_once('>') {
if document.asc_desc_rank > filter.parse().unwrap() {
if document.asc_desc_rank > filter.parse::<u32>().unwrap() {
id = Some(document.id.clone())
}
} else if filter.starts_with("_geoRadius") {

View file

@ -20,7 +20,7 @@ const DISALLOW_OPTIONAL_WORDS: TermsMatchingStrategy = TermsMatchingStrategy::Al
const ASC_DESC_CANDIDATES_THRESHOLD: usize = 1000;
macro_rules! test_criterion {
($func:ident, $optional_word:ident, $criteria:expr, $sort_criteria:expr) => {
($func:ident, $optional_word:ident, $criteria:expr_2021, $sort_criteria:expr_2021) => {
#[test]
fn $func() {
let criteria = $criteria;