Skip to content

Commit

Permalink
lattice: add new clone method
Browse files Browse the repository at this point in the history
  • Loading branch information
ybyygu committed Sep 11, 2023
1 parent 134d964 commit 48abc68
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ impl PyLattice {
pub fn scale_by_c(&mut self, v: f64) {
self.inner.scale_by_c(v)
}

/// Create a new copy of `Lattice`.
pub fn clone(&self) -> Self {
let inner = self.inner.clone();
Self { inner }
}
}
// c8807c91 ends here

Expand Down

0 comments on commit 48abc68

Please sign in to comment.