Skip to content

Commit

Permalink
refactor: Enable derive_default feature & refactor code according it
Browse files Browse the repository at this point in the history
  • Loading branch information
IshanGrover2004 committed May 27, 2024
1 parent e2d9f3a commit c5dadaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ fn main() {
}

let bindings = builder
.derive_default(true)
.no_default("dtvcc_pen_attribs|dtvcc_pen_color|dtvcc_symbol")
// Finish the builder and generate the bindings.
.generate()
// Unwrap the Result and panic on failure.
Expand Down
7 changes: 7 additions & 0 deletions src/rust/src/decoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,10 @@ impl dtvcc_symbol {
is_true(self.init)
}
}

impl Default for dtvcc_symbol {
/// Create a blank uninitialized symbol
fn default() -> Self {
Self { sym: 0, init: 0 }
}
}

0 comments on commit c5dadaa

Please sign in to comment.