From 34932cb2959baa96a229b1e9f5cc3b1d0271ca67 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 27 Dec 2022 15:49:55 +0100 Subject: [PATCH] Fix clippy: Implement From instead of Into Signed-off-by: Matthias Beyer --- src/requests/statuses.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/requests/statuses.rs b/src/requests/statuses.rs index 4d260dc..0e5d81f 100644 --- a/src/requests/statuses.rs +++ b/src/requests/statuses.rs @@ -50,16 +50,16 @@ pub struct StatusesRequest<'a> { min_id: Option>, } -impl<'a> Into>> for &'a mut StatusesRequest<'a> { - fn into(self) -> Option> { +impl<'a> From<&'a mut StatusesRequest<'a>> for Option> { + fn from(sr: &'a mut StatusesRequest<'a>) -> Self { Some(StatusesRequest { - only_media: self.only_media, - exclude_replies: self.exclude_replies, - pinned: self.pinned, - max_id: self.max_id.clone(), - since_id: self.since_id.clone(), - limit: self.limit, - min_id: self.min_id.clone(), + only_media: sr.only_media, + exclude_replies: sr.exclude_replies, + pinned: sr.pinned, + max_id: sr.max_id.clone(), + since_id: sr.since_id.clone(), + limit: sr.limit, + min_id: sr.min_id.clone(), }) } }