Skip to content

Commit

Permalink
fix(rust): default value for teletext
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekmedia committed May 11, 2024
1 parent 36aa62a commit a4aa3c6
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/rust/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::bindings::*;
use crate::utils::string_to_c_char;
use crate::utils::string_to_c_chars;

#[derive(Debug, Default)]
#[derive(Debug)]
pub struct CcxTeletextConfig {
pub verbose: bool,
pub page: u16,
Expand All @@ -28,6 +28,35 @@ pub struct CcxTeletextConfig {
pub latrusmap: bool,
}

impl Default for CcxTeletextConfig {
fn default() -> Self {
Self {
verbose: true,
page: 0,
tid: 0,
offset: 0.0,
bom: true,
nonempty: true,
user_page: 0,
dolevdist: 0,
levdistmincnt: 0,
levdistmaxpct: 0,
extraction_start: CcxBoundaryTime::default(),
extraction_end: CcxBoundaryTime::default(),
write_format: CcxOutputFormat::default(),
gui_mode_reports: false,
date_format: CcxOutputDateFormat::default(),
noautotimeref: false,
send_to_srv: false,
encoding: CcxEncodingType::default(),
nofontcolor: false,
nohtmlescape: false,
millis_separator: ',',
latrusmap: false,
}
}
}

impl CcxTeletextConfig {
pub fn to_ctype(&self) -> ccx_s_teletext_config {
let mut config = ccx_s_teletext_config {
Expand Down

0 comments on commit a4aa3c6

Please sign in to comment.