From a5185346f7714b380df3d7038a541660dc2ba434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Roll=C3=A9n?= <38324289+SebRollen@users.noreply.github.com> Date: Tue, 16 Nov 2021 15:52:00 -0500 Subject: [PATCH] fix: require functions in paginators to be thread-safe (#12) --- src/pagination.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pagination.rs b/src/pagination.rs index 4087b67..502ad03 100644 --- a/src/pagination.rs +++ b/src/pagination.rs @@ -88,12 +88,12 @@ pub mod query { /// A paginator that implements pagination through one or more query parameters. pub struct QueryPaginator { - f: Box, &T) -> Option>, + f: Box, &T) -> Option>, _phantom: std::marker::PhantomData, } impl QueryPaginator { - pub fn new, &T) -> Option>(f: F) -> Self { + pub fn new, &T) -> Option>(f: F) -> Self { Self { f: Box::new(f), _phantom: std::marker::PhantomData, @@ -166,12 +166,12 @@ pub mod path { /// the paginator should return the path segment number and the new path segment, e.g. (2, "foo") /// represents changing the third path segment to "foo" pub struct PathPaginator { - f: Box, &T) -> Option>, + f: Box, &T) -> Option>, _phantom: std::marker::PhantomData, } impl PathPaginator { - pub fn new, &T) -> Option>(f: F) -> Self { + pub fn new, &T) -> Option>(f: F) -> Self { Self { f: Box::new(f), _phantom: std::marker::PhantomData,