fix some warnings (unneeded parentheses, missing dyn keyword)
[nihav.git] / nihav-core / src / io / codebook.rs
index d835ce31501af39b963a0e6985a09299ca0da690..0ec88833abb081485acf1e3dd3dec05a603713b0 100644 (file)
@@ -113,6 +113,7 @@ pub struct ShortCodebookDesc {
 ///
 /// [`ShortCodebookDescReader`]: ./struct.ShortCodebookDescReader.html
 /// [`TableCodebookDescReader`]: ./struct.TableCodebookDescReader.html
+#[allow(clippy::len_without_is_empty)]
 pub trait CodebookDescReader<S> {
     /// Returns the codeword length for the provided index.
     fn bits(&mut self, idx: usize) -> u8;
@@ -288,7 +289,7 @@ fn build_esc_lut(table: &mut Vec<u32>,
 impl<S: Copy> Codebook<S> {
 
     /// Constructs a new `Codebook` instance using provided codebook description and mode.
-    pub fn new(cb: &mut CodebookDescReader<S>, mode: CodebookMode) -> CodebookResult<Self> {
+    pub fn new(cb: &mut dyn CodebookDescReader<S>, mode: CodebookMode) -> CodebookResult<Self> {
         let mut maxbits = 0;
         let mut nnz = 0;
         let mut escape_list: EscapeCodes = HashMap::new();