From df2fe3f818e496383643f4bbda4a4e646f5e69fa Mon Sep 17 00:00:00 2001 From: Philipp Korber Date: Mon, 4 Feb 2019 11:38:45 +0100 Subject: chore(rust): Use UFC Syntax for any custom `type_id` methods. This is neccessary as `Any::get_type_id` is getting stabilized as `Any::type_id` leading to potential brakage wrt. the compiler failing due to syntax ambiguity. --- headers/Cargo.toml | 2 +- headers/src/header.rs | 2 +- internals/Cargo.toml | 2 +- internals/src/encoder/encodable.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/Cargo.toml b/headers/Cargo.toml index ff37c5a..1526ab3 100644 --- a/headers/Cargo.toml +++ b/headers/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "mail-headers" description = "[mail/headers] header parts for the mail crate (inkl. header map and standard header impl)" -version = "0.6.2" +version = "0.6.3" authors = ["Philipp Korber "] documentation = "https://docs.rs/mail-headers" keywords = [] diff --git a/headers/src/header.rs b/headers/src/header.rs index ae63632..b032e53 100644 --- a/headers/src/header.rs +++ b/headers/src/header.rs @@ -197,7 +197,7 @@ impl HeaderObj { pub fn is(&self) -> bool where H: HeaderKind { - self.type_id() == TypeId::of::>() + HeaderObjTrait::type_id(self) == TypeId::of::>() } pub fn downcast_ref(&self) -> Option<&Header> diff --git a/internals/Cargo.toml b/internals/Cargo.toml index 1808868..3d92ff6 100644 --- a/internals/Cargo.toml +++ b/internals/Cargo.toml @@ -7,7 +7,7 @@ keywords = ["mail-api"] categories = [] license = "MIT OR Apache-2.0" repository = "https://github.com/1aim/mail" -version = "0.2.0" +version = "0.2.1" readme = "./README.md" [dependencies] diff --git a/internals/src/encoder/encodable.rs b/internals/src/encoder/encodable.rs index b06a9bc..ff1e29a 100644 --- a/internals/src/encoder/encodable.rs +++ b/internals/src/encoder/encodable.rs @@ -18,7 +18,7 @@ pub trait EncodableInHeader: Send + Sync + Any + Debug { fn boxed_clone(&self) -> Box; #[doc(hidden)] - fn type_id( &self ) -> TypeId { + fn type_id(&self) -> TypeId { TypeId::of::() } } @@ -28,7 +28,7 @@ impl EncodableInHeader { #[inline(always)] pub fn is(&self) -> bool { - self.type_id() == TypeId::of::() + EncodableInHeader::type_id(self) == TypeId::of::() } -- cgit v1.2.3