Skip to content

Commit

Permalink
refactor(computegraph): use dyn_clone macro (#15)
Browse files Browse the repository at this point in the history
Instead of manual implementation of the Clone trait.
  • Loading branch information
maximmaxim345 authored Jun 27, 2024
2 parents 7282073 + 0b7e19b commit 9479ace
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/computegraph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,7 @@ pub trait ExecutableNode: std::fmt::Debug + DynClone {
fn run(&self, input: &[Box<dyn Any>]) -> Vec<Box<dyn Any>>;
}

impl Clone for Box<dyn ExecutableNode> {
fn clone(&self) -> Self {
dyn_clone::clone_box(self.as_ref())
}
}
dyn_clone::clone_trait_object!(ExecutableNode);

/// Trait for building a node.
///
Expand Down

0 comments on commit 9479ace

Please sign in to comment.