mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Merge pull request #332 from teloxide/fix-serde-export-master
Fix serde export
This commit is contained in:
commit
fe6429c279
4 changed files with 15 additions and 5 deletions
|
@ -26,6 +26,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
[issue 253]: https://github.com/teloxide/teloxide/issues/253
|
[issue 253]: https://github.com/teloxide/teloxide/issues/253
|
||||||
[pr 257]: https://github.com/teloxide/teloxide/pull/257
|
[pr 257]: https://github.com/teloxide/teloxide/pull/257
|
||||||
|
|
||||||
|
## [0.3.4] - 2020-01-13
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Failing compilation with `serde::export` ([issue 328](https://github.com/teloxide/teloxide/issues/328)).
|
||||||
|
|
||||||
## [0.3.3] - 2020-10-30
|
## [0.3.3] - 2020-10-30
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "teloxide"
|
name = "teloxide"
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "An elegant Telegram bots framework for Rust"
|
description = "An elegant Telegram bots framework for Rust"
|
||||||
repository = "https://github.com/teloxide/teloxide"
|
repository = "https://github.com/teloxide/teloxide"
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
|
use std::fmt::Formatter;
|
||||||
|
|
||||||
use derive_more::From;
|
use derive_more::From;
|
||||||
use mime::Mime;
|
use mime::Mime;
|
||||||
use serde::{de::Visitor, export::Formatter, Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{de::Visitor, Deserialize, Deserializer, Serialize, Serializer};
|
||||||
|
|
||||||
/// Serializable & deserializable `MIME` wrapper.
|
/// Serializable & deserializable `MIME` wrapper.
|
||||||
#[derive(Clone, Debug, Eq, Hash, PartialEq, From)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, From)]
|
||||||
|
@ -19,7 +21,7 @@ struct MimeVisitor;
|
||||||
impl<'a> Visitor<'a> for MimeVisitor {
|
impl<'a> Visitor<'a> for MimeVisitor {
|
||||||
type Value = MimeWrapper;
|
type Value = MimeWrapper;
|
||||||
|
|
||||||
fn expecting(&self, formatter: &mut Formatter<'_>) -> Result<(), serde::export::fmt::Error> {
|
fn expecting(&self, formatter: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
|
||||||
formatter.write_str("mime type")
|
formatter.write_str("mime type")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,10 @@
|
||||||
//!
|
//!
|
||||||
//! [examples/admin_bot]: https://github.com/teloxide/teloxide/blob/master/examples/admin_bot/
|
//! [examples/admin_bot]: https://github.com/teloxide/teloxide/blob/master/examples/admin_bot/
|
||||||
|
|
||||||
use serde::export::Formatter;
|
use std::{
|
||||||
use std::{error::Error, fmt::Display};
|
error::Error,
|
||||||
|
fmt::{Display, Formatter},
|
||||||
|
};
|
||||||
|
|
||||||
#[cfg(feature = "macros")]
|
#[cfg(feature = "macros")]
|
||||||
// FIXME(waffle): use `docsrs` here when issue with combine is resolved <https://github.com/teloxide/teloxide/pull/305#issuecomment-716172103>
|
// FIXME(waffle): use `docsrs` here when issue with combine is resolved <https://github.com/teloxide/teloxide/pull/305#issuecomment-716172103>
|
||||||
|
|
Loading…
Reference in a new issue