Skip to content

Commit

Permalink
rust: Drop Operator::new()
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Aug 21, 2024
1 parent 787ca42 commit 1656cfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions crates/dekoder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,10 @@ pub struct Operator {
pub op: Option<Array4<f64>>,
}

impl Operator {
/// Empty initializer.
pub fn new() -> Self {
Self { op: None }
}
}

impl Default for Operator {
/// Empty initializer.
fn default() -> Self {
Self::new()
Self { op: None }
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/dekoder/tests/test_load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn load_operator() {
scale: 10000.,
nf: 4,
};
let mut op = Operator::new();
let mut op = Operator::default();
eko.load_operator(&ep, &mut op).unwrap();
assert!(op.op.is_some());
assert!(op.op.unwrap().dim().0 > 0);
Expand Down

0 comments on commit 1656cfc

Please sign in to comment.