aboutsummaryrefslogtreecommitdiffstats
path: root/src/macros.rs
diff options
context:
space:
mode:
authorC. Morgan Hamill <me@cmhamill.org>2015-03-26 19:41:54 +0100
committerC. Morgan Hamill <me@cmhamill.org>2015-03-26 19:41:54 +0100
commite4523dd5d6e2fe3f9afa99671baadfdf8eef5385 (patch)
tree6977dbec192d49852fa57e5f9281a8a8c88febfa /src/macros.rs
parenta2300c78a747124003c8415b805712aed31e4959 (diff)
downloadmail-e4523dd5d6e2fe3f9afa99671baadfdf8eef5385.tar.gz
Remove `NotmuchType` trait.
No longer necessary with the `From` and `Into` traits from std::convert.
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/macros.rs b/src/macros.rs
index 8802a71..a36197b 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -16,16 +16,16 @@ macro_rules! notmuch_enum {
$($variant_alias),*
}
- impl NotmuchType for $name_alias {
- type NotmuchT = $name;
-
- fn from_notmuch_t(notmuch_t: $name) -> Self {
- match notmuch_t {
+ impl From<$name> for $name_alias {
+ fn from(t: $name) -> Self {
+ match t {
$($name::$variant => $name_alias::$variant_alias),*
}
}
+ }
- fn to_notmuch_t(self) -> $name {
+ impl Into<$name> for $name_alias {
+ fn into(self) -> $name {
match self {
$($name_alias::$variant_alias => $name::$variant),*
}