Derive Default on IndexerOpts

This commit is contained in:
Clément Renault 2023-01-05 16:00:45 +01:00
parent cda529c07b
commit aa4b813237
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -489,7 +489,7 @@ impl Opt {
}
}
#[derive(Debug, Clone, Parser, Deserialize)]
#[derive(Debug, Default, Clone, Parser, Deserialize)]
pub struct IndexerOpts {
/// Sets the maximum amount of RAM Meilisearch can use when indexing. By default, Meilisearch
/// uses no more than two thirds of available memory.
@ -541,15 +541,6 @@ impl TryFrom<&IndexerOpts> for IndexerConfig {
}
}
impl Default for IndexerOpts {
fn default() -> Self {
Self {
max_indexing_memory: MaxMemory::default(),
max_indexing_threads: MaxThreads::default(),
}
}
}
/// A type used to detect the max memory available and use 2/3 of it.
#[derive(Debug, Clone, Copy, Deserialize, Serialize)]
pub struct MaxMemory(Option<Byte>);