From 9cc5806f0779585ad6702d8f227aeae04a1ed1f5 Mon Sep 17 00:00:00 2001 From: Waffle Date: Thu, 19 Sep 2019 01:45:40 +0300 Subject: [PATCH] Fix some visibility issues that were causing warnings --- src/core/requests/get_file.rs | 8 ++++++-- src/core/requests/send_chat_action.rs | 4 ++-- src/core/requests/send_contact.rs | 2 +- src/core/requests/send_poll.rs | 2 +- src/core/requests/send_venue.rs | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/core/requests/get_file.rs b/src/core/requests/get_file.rs index 089ff743..9ab0788d 100644 --- a/src/core/requests/get_file.rs +++ b/src/core/requests/get_file.rs @@ -12,11 +12,11 @@ use crate::core::types::File; /// It is guaranteed that the link will be valid for at least 1 hour. /// When the link expires, a new one can be requested by calling getFile again. #[derive(Debug, Clone, Serialize)] -struct GetFile<'a> { +pub struct GetFile<'a> { #[serde(skip_serializing)] ctx: RequestContext<'a>, /// File identifier to get info about - file_id: String, + pub file_id: String, } impl<'a> Request<'a> for GetFile<'a> { @@ -36,6 +36,10 @@ impl<'a> Request<'a> for GetFile<'a> { } impl<'a> GetFile<'a> { + pub(crate) fn new(ctx: RequestContext<'a>, file_id: String) -> Self { + Self { ctx, file_id } + } + pub fn file_id(mut self, file_id: T) -> Self where T: Into, diff --git a/src/core/requests/send_chat_action.rs b/src/core/requests/send_chat_action.rs index ae07ec05..9b9bf940 100644 --- a/src/core/requests/send_chat_action.rs +++ b/src/core/requests/send_chat_action.rs @@ -8,7 +8,7 @@ use crate::core::requests::{ /// arrives from your bot, Telegram clients clear its typing status). /// Returns True on success. #[derive(Debug, Clone, Serialize)] -struct SendChatAction<'a> { +pub struct SendChatAction<'a> { #[serde(skip_serializing)] ctx: RequestContext<'a>, /// Unique identifier for the target chat or @@ -24,7 +24,7 @@ struct SendChatAction<'a> { #[derive(Debug, Serialize, From, Clone)] #[serde(rename_all = "snake_case")] -enum ChatAction { +pub enum ChatAction { Typing, UploadPhoto, RecordVideo, diff --git a/src/core/requests/send_contact.rs b/src/core/requests/send_contact.rs index 16cbec0e..a064dd21 100644 --- a/src/core/requests/send_contact.rs +++ b/src/core/requests/send_contact.rs @@ -7,7 +7,7 @@ use crate::core::types::{Message, ReplyMarkup}; /// Use this method to send phone contacts. /// returned. #[derive(Debug, Clone, Serialize)] -struct SendContact<'a> { +pub struct SendContact<'a> { #[serde(skip_serializing)] ctx: RequestContext<'a>, /// Unique identifier for the target chat or diff --git a/src/core/requests/send_poll.rs b/src/core/requests/send_poll.rs index 861c98e7..92a11901 100644 --- a/src/core/requests/send_poll.rs +++ b/src/core/requests/send_poll.rs @@ -7,7 +7,7 @@ use crate::core::types::{Message, ReplyMarkup}; /// Use this method to send a native poll. A native poll can't be sent to a /// private chat. On success, the sent Message is returned. #[derive(Debug, Clone, Serialize)] -struct SendPoll<'a> { +pub struct SendPoll<'a> { #[serde(skip_serializing)] ctx: RequestContext<'a>, /// identifier for the target chat or username of the target channel (in diff --git a/src/core/requests/send_venue.rs b/src/core/requests/send_venue.rs index 85fee6d6..cdb5fb90 100644 --- a/src/core/requests/send_venue.rs +++ b/src/core/requests/send_venue.rs @@ -7,7 +7,7 @@ use crate::core::types::{Message, ReplyMarkup}; /// Use this method to send information about a venue. /// Message is returned. #[derive(Debug, Clone, Serialize)] -struct SendVenue<'a> { +pub struct SendVenue<'a> { #[serde(skip_serializing)] ctx: RequestContext<'a>, /// Unique identifier for the target chat or @@ -62,7 +62,7 @@ impl<'a> Request<'a> for SendVenue<'a> { } impl<'a> SendVenue<'a> { - pub fn new( + pub(crate) fn new( ctx: RequestContext<'a>, chat_id: ChatId, latitude: f64,