mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Use serde-cs::CS with StarOr to reduce the logic duplication
This commit is contained in:
parent
10d3b367dc
commit
64b5b2e1f8
3 changed files with 20 additions and 14 deletions
|
@ -49,7 +49,10 @@ impl<T: FromStr> FromStr for StarOr<T> {
|
|||
|
||||
/// Extracts the raw values from the `StarOr` types and
|
||||
/// return None if a `StarOr::Star` is encountered.
|
||||
pub fn fold_star_or<T>(content: impl IntoIterator<Item = StarOr<T>>) -> Option<Vec<T>> {
|
||||
pub fn fold_star_or<T, O>(content: impl IntoIterator<Item = StarOr<T>>) -> Option<O>
|
||||
where
|
||||
O: FromIterator<T>,
|
||||
{
|
||||
content
|
||||
.into_iter()
|
||||
.map(|value| match value {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue