mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-26 00:17:08 +01:00
cargo fmt
This commit is contained in:
parent
466ec638a4
commit
334ee73a40
1 changed files with 22 additions and 23 deletions
|
@ -1,8 +1,11 @@
|
||||||
use crate::core::network;
|
use crate::core::network;
|
||||||
use crate::core::requests::{ChatId, Request, RequestContext, RequestFuture, ResponseResult};
|
use crate::core::requests::{
|
||||||
|
ChatId, Request, RequestContext, RequestFuture, ResponseResult,
|
||||||
|
};
|
||||||
use crate::core::types::{Message, ReplyMarkup};
|
use crate::core::types::{Message, ReplyMarkup};
|
||||||
|
|
||||||
///Use this method to send phone contacts. On success, the sent Message is returned.
|
///Use this method to send phone contacts. On success, the sent Message is
|
||||||
|
/// returned.
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
struct SendContact<'a> {
|
struct SendContact<'a> {
|
||||||
#[serde(skip_serializing)]
|
#[serde(skip_serializing)]
|
||||||
|
@ -37,7 +40,6 @@ struct SendContact<'a> {
|
||||||
pub reply_markup: Option<ReplyMarkup>,
|
pub reply_markup: Option<ReplyMarkup>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl<'a> Request<'a> for SendContact<'a> {
|
impl<'a> Request<'a> for SendContact<'a> {
|
||||||
type ReturnValue = Message;
|
type ReturnValue = Message;
|
||||||
|
|
||||||
|
@ -49,12 +51,11 @@ impl<'a> Request<'a> for SendContact<'a> {
|
||||||
"sendContact",
|
"sendContact",
|
||||||
&self,
|
&self,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl<'a> SendContact<'a> {
|
impl<'a> SendContact<'a> {
|
||||||
pub(crate) fn new(
|
pub(crate) fn new(
|
||||||
ctx: RequestContext<'a>,
|
ctx: RequestContext<'a>,
|
||||||
|
@ -76,66 +77,64 @@ impl<'a> SendContact<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn chat_id<T>(mut self, chat_id: T) -> Self
|
pub fn chat_id<T>(mut self, chat_id: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<ChatId>,
|
T: Into<ChatId>,
|
||||||
{
|
{
|
||||||
self.chat_id = chat_id.into();
|
self.chat_id = chat_id.into();
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn phone_number<T>(mut self, phone_number: T) -> Self
|
pub fn phone_number<T>(mut self, phone_number: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<String>,
|
T: Into<String>,
|
||||||
{
|
{
|
||||||
self.phone_number = phone_number.into();
|
self.phone_number = phone_number.into();
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn first_name<T>(mut self, first_name: T) -> Self
|
pub fn first_name<T>(mut self, first_name: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<String>,
|
T: Into<String>,
|
||||||
{
|
{
|
||||||
self.first_name = first_name.into();
|
self.first_name = first_name.into();
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn last_name<T>(mut self, last_name: T) -> Self
|
pub fn last_name<T>(mut self, last_name: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<String>,
|
T: Into<String>,
|
||||||
{
|
{
|
||||||
self.last_name = Some(last_name.into());
|
self.last_name = Some(last_name.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn vcard<T>(mut self, vcard: T) -> Self
|
pub fn vcard<T>(mut self, vcard: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<String>,
|
T: Into<String>,
|
||||||
{
|
{
|
||||||
self.vcard = Some(vcard.into());
|
self.vcard = Some(vcard.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn disable_notification<T>(mut self, disable_notification: T) -> Self
|
pub fn disable_notification<T>(mut self, disable_notification: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<bool>,
|
T: Into<bool>,
|
||||||
{
|
{
|
||||||
self.disable_notification = Some(disable_notification.into());
|
self.disable_notification = Some(disable_notification.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn reply_to_message_id<T>(mut self, reply_to_message_id: T) -> Self
|
pub fn reply_to_message_id<T>(mut self, reply_to_message_id: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<i32>,
|
T: Into<i32>,
|
||||||
{
|
{
|
||||||
self.reply_to_message_id = Some(reply_to_message_id.into());
|
self.reply_to_message_id = Some(reply_to_message_id.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn reply_markup<T>(mut self, reply_markup: T) -> Self
|
pub fn reply_markup<T>(mut self, reply_markup: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<ReplyMarkup>,
|
T: Into<ReplyMarkup>,
|
||||||
{
|
{
|
||||||
self.reply_markup = Some(reply_markup.into());
|
self.reply_markup = Some(reply_markup.into());
|
||||||
self
|
self
|
||||||
|
|
Loading…
Add table
Reference in a new issue