aboutsummaryrefslogtreecommitdiff
path: root/server/src/helper
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/helper')
-rw-r--r--server/src/helper/filter_sort.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/src/helper/filter_sort.rs b/server/src/helper/filter_sort.rs
index 10d397a..fa96662 100644
--- a/server/src/helper/filter_sort.rs
+++ b/server/src/helper/filter_sort.rs
@@ -15,10 +15,10 @@ use rocket::{
UriDisplayQuery,
};
-impl Into<NodeFilterSort> for ANodeFilterSort {
- fn into(self) -> NodeFilterSort {
+impl From<ANodeFilterSort> for NodeFilterSort {
+ fn from(val: ANodeFilterSort) -> Self {
NodeFilterSort {
- sort_by: self.sort_by.map(|e| match e {
+ sort_by: val.sort_by.map(|e| match e {
ASortProperty::ReleaseDate => SortProperty::ReleaseDate,
ASortProperty::Title => SortProperty::Title,
ASortProperty::Index => SortProperty::Index,
@@ -33,7 +33,7 @@ impl Into<NodeFilterSort> for ANodeFilterSort {
ASortProperty::RatingUser => SortProperty::RatingUser,
ASortProperty::RatingLikesDivViews => SortProperty::RatingLikesDivViews,
}),
- filter_kind: self.filter_kind.map(|l| {
+ filter_kind: val.filter_kind.map(|l| {
l.into_iter()
.map(|e| match e {
AFilterProperty::FederationLocal => FilterProperty::FederationLocal,
@@ -54,7 +54,7 @@ impl Into<NodeFilterSort> for ANodeFilterSort {
})
.collect()
}),
- sort_order: self.sort_order.map(|e| match e {
+ sort_order: val.sort_order.map(|e| match e {
ASortOrder::Ascending => SortOrder::Ascending,
ASortOrder::Descending => SortOrder::Descending,
}),