Skip to content

Commit

Permalink
use impl in new
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Jun 29, 2023
1 parent 014c91b commit c9ea695
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ops/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ pub struct OpaqueOp {

impl OpaqueOp {
/// Initialize a new named OpaqueOp
pub fn new(id: impl Into<SmolStr>, custom: Box<dyn CustomOp>) -> Self {
pub fn new(id: impl Into<SmolStr>, custom: impl CustomOp) -> Self {
Self {
id: id.into(),
custom,

custom: Box::new(custom),
}
}

Expand Down

0 comments on commit c9ea695

Please sign in to comment.