Remove LanguageCode

Because the official Telegram documentation doesn't specify a concrete version of IETF language tag.
This commit is contained in:
Temirkhan Myrzamadi 2020-02-24 21:21:53 +06:00
parent 54b6fdfbbe
commit d165de64d7
4 changed files with 2 additions and 198 deletions

View file

@ -1,193 +0,0 @@
use serde::{Deserialize, Serialize};
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum LanguageCode {
AA,
AB,
AE,
AF,
AK,
AM,
AN,
AR,
AS,
AV,
AY,
AZ,
BA,
BE,
BG,
BH,
BI,
BM,
BN,
BO,
BR,
BS,
CA,
CE,
CH,
CO,
CR,
CS,
CU,
CV,
CY,
DA,
DE,
DV,
DZ,
EE,
EL,
EN,
EO,
ES,
ET,
EU,
FA,
FF,
FI,
FJ,
FO,
FR,
FY,
GA,
GD,
GL,
GN,
GU,
GV,
HA,
HE,
HI,
HO,
HR,
HT,
HU,
HY,
HZ,
IA,
ID,
IE,
IG,
II,
IK,
IO,
IS,
IT,
IU,
JA,
JV,
KA,
KG,
KI,
KJ,
KK,
KL,
KM,
KN,
KO,
KR,
KS,
KU,
KV,
KW,
KY,
LA,
LB,
LG,
LI,
LN,
LO,
LT,
LU,
LV,
MG,
MH,
MI,
MK,
ML,
MN,
MR,
MS,
MT,
MY,
NA,
NB,
ND,
NE,
NG,
NL,
NN,
NO,
NR,
NV,
NY,
OC,
OJ,
OM,
OR,
OS,
PA,
PI,
PL,
PS,
PT,
QU,
RM,
RN,
RO,
RU,
RW,
SA,
SC,
SD,
SE,
SG,
SI,
SK,
SL,
SM,
SN,
SO,
SQ,
SR,
SS,
ST,
SU,
SV,
SW,
TA,
TE,
TG,
TH,
TI,
TK,
TL,
TN,
TO,
TR,
TS,
TT,
TW,
TY,
UG,
UK,
UR,
UZ,
VE,
VI,
VO,
WA,
WO,
XH,
YI,
YO,
ZA,
ZH,
ZU,
#[serde(other)]
Other,
}

View file

@ -1,9 +1,7 @@
pub use country_code::*;
pub use currency::*;
pub use language_code::*;
pub use mime_wrapper::*;
mod country_code;
mod currency;
mod language_code;
mod mime_wrapper;

View file

@ -1,4 +1,3 @@
use crate::types::LanguageCode;
use serde::{Deserialize, Serialize};
/// This object represents a Telegram user or bot.
@ -25,7 +24,7 @@ pub struct User {
/// [IETF language tag] of the user's language.
///
/// [IETF language tag]: https://en.wikipedia.org/wiki/IETF_language_tag
pub language_code: Option<LanguageCode>,
pub language_code: Option<String>,
}
impl User {

View file

@ -134,7 +134,7 @@ where
///
/// `prefix`: symbols, which denote start of a command.
///
/// Example:
/// ## Example
/// ```
/// use teloxide::utils::command::parse_command_with_prefix;
///