diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-12-20 20:18:32 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-12-20 20:18:32 +0300 |
commit | 8e1428c0473817f7be6db9972284078b00ef0a7a (patch) | |
tree | 8884fc24c953e5622d362c7cb321934bf21c12bb | |
parent | a99522150b3bb323912f274db7d3b10af9f309fd (diff) |
Implement Error/Display for AdapterError
-rw-r--r-- | gst-plugin/src/adapter.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gst-plugin/src/adapter.rs b/gst-plugin/src/adapter.rs index 4c93faf6d..ddebde027 100644 --- a/gst-plugin/src/adapter.rs +++ b/gst-plugin/src/adapter.rs @@ -9,6 +9,8 @@ use std::collections::VecDeque; use std::cmp; use std::io; +use std::fmt; +use std::error::Error; use gst; use gst::prelude::*; @@ -35,6 +37,18 @@ pub enum AdapterError { NotEnoughData, } +impl fmt::Display for AdapterError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Not enough data") + } +} + +impl Error for AdapterError { + fn description(&self) -> &str { + "Not enough data" + } +} + impl Adapter { pub fn new() -> Adapter { Adapter { |