mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-11 15:16:35 +00:00
remove all warnings
This commit is contained in:
@ -45,7 +45,7 @@ use uuid::Uuid;
|
||||
|
||||
use crate::{IndexMetadata, Result, Version};
|
||||
|
||||
use super::{compat::v5_to_v6::CompatV5ToV6, DumpReader, IndexReader};
|
||||
use super::compat::v5_to_v6::CompatV5ToV6;
|
||||
|
||||
pub mod errors;
|
||||
pub mod keys;
|
||||
@ -65,20 +65,16 @@ pub type Key = keys::Key;
|
||||
// ===== Other types to clarify the code of the compat module
|
||||
// everything related to the tasks
|
||||
pub type Status = tasks::TaskStatus;
|
||||
pub type Kind = tasks::TaskType;
|
||||
pub type Details = tasks::TaskDetails;
|
||||
|
||||
// everything related to the settings
|
||||
pub type Setting<T> = settings::Setting<T>;
|
||||
pub type TypoTolerance = settings::TypoSettings;
|
||||
pub type MinWordSizeForTypos = settings::MinWordSizeTyposSetting;
|
||||
pub type FacetingSettings = settings::FacetingSettings;
|
||||
pub type PaginationSettings = settings::PaginationSettings;
|
||||
|
||||
// everything related to the api keys
|
||||
pub type Action = keys::Action;
|
||||
pub type StarOr<T> = meta::StarOr<T>;
|
||||
pub type IndexUid = meta::IndexUid;
|
||||
|
||||
// everything related to the errors
|
||||
pub type ResponseError = errors::ResponseError;
|
||||
|
@ -3,7 +3,7 @@ use std::{
|
||||
marker::PhantomData,
|
||||
};
|
||||
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, Serialize, PartialEq, Eq)]
|
||||
pub struct Checked;
|
||||
@ -49,22 +49,6 @@ pub struct Settings<T> {
|
||||
pub _kind: PhantomData<T>,
|
||||
}
|
||||
|
||||
fn serialize_with_wildcard<S>(
|
||||
field: &Setting<Vec<String>>,
|
||||
s: S,
|
||||
) -> std::result::Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
let wildcard = vec!["*".to_string()];
|
||||
match field {
|
||||
Setting::Set(value) => Some(value),
|
||||
Setting::Reset => Some(&wildcard),
|
||||
Setting::NotSet => None,
|
||||
}
|
||||
.serialize(s)
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Copy)]
|
||||
#[cfg_attr(test, derive(serde::Serialize))]
|
||||
pub enum Setting<T> {
|
||||
|
@ -1,6 +1,4 @@
|
||||
use std::fmt::Write;
|
||||
|
||||
use serde::{Deserialize, Serializer};
|
||||
use serde::Deserialize;
|
||||
use time::{Duration, OffsetDateTime};
|
||||
use uuid::Uuid;
|
||||
|
||||
@ -427,10 +425,13 @@ pub enum TaskDetails {
|
||||
/// Serialize a `time::Duration` as a best effort ISO 8601 while waiting for
|
||||
/// https://github.com/time-rs/time/issues/378.
|
||||
/// This code is a port of the old code of time that was removed in 0.2.
|
||||
fn serialize_duration<S: Serializer>(
|
||||
#[cfg(test)]
|
||||
fn serialize_duration<S: serde::Serializer>(
|
||||
duration: &Option<Duration>,
|
||||
serializer: S,
|
||||
) -> Result<S::Ok, S::Error> {
|
||||
use std::fmt::Write;
|
||||
|
||||
match duration {
|
||||
Some(duration) => {
|
||||
// technically speaking, negative duration is not valid ISO 8601
|
||||
|
Reference in New Issue
Block a user