fix optional value

This commit is contained in:
nextel 2019-09-21 20:09:35 +03:00
parent c3f543786d
commit 3443942cf9

View file

@ -12,9 +12,11 @@ pub struct GetUserProfilePhotos<'a> {
user_id: i32, user_id: i32,
/// Sequential number of the first photo to be returned. By default, all /// Sequential number of the first photo to be returned. By default, all
/// photos are returned. /// photos are returned.
#[serde(skip_serializing_if = "Option::is_none")]
offset: Option<i64>, offset: Option<i64>,
///Limits the number of photos to be retrieved. Values between 1—100 are ///Limits the number of photos to be retrieved. Values between 1—100 are
/// accepted. Defaults to 100. /// accepted. Defaults to 100.
#[serde(skip_serializing_if = "Option::is_none")]
limit: Option<i64>, limit: Option<i64>,
} }
@ -59,4 +61,13 @@ impl<'a> GetUserProfilePhotos<'a> {
self.offset = Some(offset.into()); self.offset = Some(offset.into());
self self
} }
pub fn limit<T>(mut self, limit: T) -> Self
where
T: Into<i64>,
{
self.limit = Some(limit.into());
self
}
} }