diff options
| author | C. Morgan Hamill <me@cmhamill.org> | 2015-03-26 19:41:54 +0100 |
|---|---|---|
| committer | C. Morgan Hamill <me@cmhamill.org> | 2015-03-26 19:41:54 +0100 |
| commit | e4523dd5d6e2fe3f9afa99671baadfdf8eef5385 (patch) | |
| tree | 6977dbec192d49852fa57e5f9281a8a8c88febfa /src/macros.rs | |
| parent | a2300c78a747124003c8415b805712aed31e4959 (diff) | |
| download | mail-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.rs | 12 |
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),* } |
