diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2020-07-06 18:34:39 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2020-07-06 18:34:39 +0200 |
commit | 81b94329a275bb92066404bd3bb2822c5bb3f424 (patch) | |
tree | 1196d3f51ae0b9bd14ea8738424a17617b541f63 | |
parent | 11d889bb61c211af010e9087ee01fe0f1c62e8a9 (diff) | |
download | nihav-81b94329a275bb92066404bd3bb2822c5bb3f424.tar.gz |
core/formats: implement ToString instead of Display for NAChannelType
-rw-r--r-- | nihav-core/src/formats.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/nihav-core/src/formats.rs b/nihav-core/src/formats.rs index d2f1c25..4c577cf 100644 --- a/nihav-core/src/formats.rs +++ b/nihav-core/src/formats.rs @@ -220,9 +220,9 @@ impl FromStr for NAChannelType { } } -impl fmt::Display for NAChannelType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let name = match *self { +impl ToString for NAChannelType { + fn to_string(&self) -> String { + match *self { NAChannelType::C => "C".to_string(), NAChannelType::L => "L".to_string(), NAChannelType::R => "R".to_string(), @@ -251,8 +251,7 @@ impl fmt::Display for NAChannelType { NAChannelType::Rt => "Rt".to_string(), NAChannelType::Lo => "Lo".to_string(), NAChannelType::Ro => "Ro".to_string(), - }; - write!(f, "{}", name) + } } } |