diff --git a/src/params.rs b/src/params.rs index 8b4ce87ad..b3655b1d1 100644 --- a/src/params.rs +++ b/src/params.rs @@ -181,13 +181,7 @@ pub trait Paginable { pub trait PaginableList { type O: Paginate + DeserializeOwned + Send + Sync + 'static + Clone + std::fmt::Debug; - fn new( - &self, - data: Vec, - url: String, - has_more: bool, - total_count: Option, - ) -> Self; + fn new(data: Vec, url: String, has_more: bool, total_count: Option) -> Self; fn get_data(&self) -> Vec; fn get_url(&self) -> String; fn get_total_count(&self) -> Option; @@ -239,13 +233,12 @@ impl, url: String, has_more: bool, total_count: Option, ) -> SearchList { - Self { object: "".to_string(), url, has_more, data: data, next_page: None, total_count } + Self { object: "".to_string(), url, has_more, data, next_page: None, total_count } } fn get_data(&self) -> Vec { @@ -255,10 +248,10 @@ impl Option { - self.total_count.clone() + self.total_count } fn has_more(&self) -> bool { - self.has_more.clone() + self.has_more } } @@ -267,14 +260,8 @@ impl, - url: String, - has_more: bool, - total_count: Option, - ) -> List { - Self { url, has_more, data: data, total_count } + fn new(data: Vec, url: String, has_more: bool, total_count: Option) -> List { + Self { url, has_more, data, total_count } } fn get_data(&self) -> Vec { @@ -284,10 +271,10 @@ impl Option { - self.total_count.clone() + self.total_count } fn has_more(&self) -> bool { - self.has_more.clone() + self.has_more } } @@ -452,7 +439,7 @@ where } } else { ok(ListPaginator { - page: self.page.new( + page: T::new( Vec::new(), self.page.get_url(), self.page.has_more(),