From 3443942cf9b5e9d8999fc7749b67a06886e9f447 Mon Sep 17 00:00:00 2001 From: nextel Date: Sat, 21 Sep 2019 20:09:35 +0300 Subject: [PATCH] fix optional value --- src/requests/get_user_profile_photos.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/requests/get_user_profile_photos.rs b/src/requests/get_user_profile_photos.rs index 619dde88..9e84d935 100644 --- a/src/requests/get_user_profile_photos.rs +++ b/src/requests/get_user_profile_photos.rs @@ -12,9 +12,11 @@ pub struct GetUserProfilePhotos<'a> { user_id: i32, /// Sequential number of the first photo to be returned. By default, all /// photos are returned. + #[serde(skip_serializing_if = "Option::is_none")] offset: Option, ///Limits the number of photos to be retrieved. Values between 1—100 are /// accepted. Defaults to 100. + #[serde(skip_serializing_if = "Option::is_none")] limit: Option, } @@ -59,4 +61,13 @@ impl<'a> GetUserProfilePhotos<'a> { self.offset = Some(offset.into()); self } + + pub fn limit(mut self, limit: T) -> Self + where + T: Into, + { + self.limit = Some(limit.into()); + self + } + }