core/codecs: implement AllocatorError -> EncoderError conversion
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 3 Jun 2020 09:44:18 +0000 (11:44 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 3 Jun 2020 09:44:18 +0000 (11:44 +0200)
nihav-core/src/codecs/mod.rs

index 516d9ace408bbc60eabc127b1e5eca6502e08749..43abbfd12ebd92209d7553ed9e327f678f9935ae 100644 (file)
@@ -158,6 +158,10 @@ impl From<ByteIOError> for EncoderError {
     fn from(_: ByteIOError) -> Self { EncoderError::Bug }
 }
 
+impl From<AllocatorError> for EncoderError {
+    fn from(_: AllocatorError) -> Self { EncoderError::AllocError }
+}
+
 /// Encoding parameter flag to force constant bitrate mode.
 pub const ENC_MODE_CBR: u64 = 1 << 0;
 /// Encoding parameter flag to force constant framerate mode.