mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
Rename TaskType::from_str parameter to 'type_'
This commit is contained in:
parent
2b944ecd89
commit
3e5d6be86b
@ -62,24 +62,24 @@ impl Error for TaskTypeError {}
|
|||||||
impl FromStr for TaskType {
|
impl FromStr for TaskType {
|
||||||
type Err = TaskTypeError;
|
type Err = TaskTypeError;
|
||||||
|
|
||||||
fn from_str(status: &str) -> Result<Self, TaskTypeError> {
|
fn from_str(type_: &str) -> Result<Self, TaskTypeError> {
|
||||||
if status.eq_ignore_ascii_case("indexCreation") {
|
if type_.eq_ignore_ascii_case("indexCreation") {
|
||||||
Ok(TaskType::IndexCreation)
|
Ok(TaskType::IndexCreation)
|
||||||
} else if status.eq_ignore_ascii_case("indexUpdate") {
|
} else if type_.eq_ignore_ascii_case("indexUpdate") {
|
||||||
Ok(TaskType::IndexUpdate)
|
Ok(TaskType::IndexUpdate)
|
||||||
} else if status.eq_ignore_ascii_case("indexDeletion") {
|
} else if type_.eq_ignore_ascii_case("indexDeletion") {
|
||||||
Ok(TaskType::IndexDeletion)
|
Ok(TaskType::IndexDeletion)
|
||||||
} else if status.eq_ignore_ascii_case("documentAdditionOrUpdate") {
|
} else if type_.eq_ignore_ascii_case("documentAdditionOrUpdate") {
|
||||||
Ok(TaskType::DocumentAdditionOrUpdate)
|
Ok(TaskType::DocumentAdditionOrUpdate)
|
||||||
} else if status.eq_ignore_ascii_case("documentDeletion") {
|
} else if type_.eq_ignore_ascii_case("documentDeletion") {
|
||||||
Ok(TaskType::DocumentDeletion)
|
Ok(TaskType::DocumentDeletion)
|
||||||
} else if status.eq_ignore_ascii_case("settingsUpdate") {
|
} else if type_.eq_ignore_ascii_case("settingsUpdate") {
|
||||||
Ok(TaskType::SettingsUpdate)
|
Ok(TaskType::SettingsUpdate)
|
||||||
} else if status.eq_ignore_ascii_case("dumpCreation") {
|
} else if type_.eq_ignore_ascii_case("dumpCreation") {
|
||||||
Ok(TaskType::DumpCreation)
|
Ok(TaskType::DumpCreation)
|
||||||
} else {
|
} else {
|
||||||
Err(TaskTypeError {
|
Err(TaskTypeError {
|
||||||
invalid_type: status.to_string(),
|
invalid_type: type_.to_string(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user