Merge pull request #246 from teloxide/remove_inline_query_methods

Remove methods for creating `InlineQuery`
This commit is contained in:
Waffle Maybe 2022-09-21 16:01:12 +04:00 committed by GitHub
commit 40e9a13d22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 55 deletions

View file

@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## unreleased
### Removed
- Methods for creating `InlineQuery` ([#246][pr244])
[pr244]: https://github.com/teloxide/teloxide-core/pull/246
## 0.7.1 - 2022-08-19
### Fixed

View file

@ -33,58 +33,3 @@ pub struct InlineQuery {
/// from a secret chat.
pub chat_type: Option<ChatType>,
}
// TODO(waffle): remove
impl InlineQuery {
pub fn new<S1, S2, S3>(id: S1, from: User, query: S2, offset: S3) -> Self
where
S1: Into<String>,
S2: Into<String>,
S3: Into<String>,
{
Self {
id: id.into(),
from,
location: None,
query: query.into(),
offset: offset.into(),
chat_type: None,
}
}
pub fn id<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.id = val.into();
self
}
#[must_use]
pub fn from(mut self, val: User) -> Self {
self.from = val;
self
}
#[must_use]
pub fn location(mut self, val: Location) -> Self {
self.location = Some(val);
self
}
pub fn query<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.query = val.into();
self
}
pub fn offset<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.offset = val.into();
self
}
}