src/loc.rs

branch
dev
changeset 162
bea0c3841ced
parent 151
402d717bb5c0
child 164
fd9dba51afd3
--- a/src/loc.rs	Tue Sep 02 15:18:30 2025 -0500
+++ b/src/loc.rs	Wed Sep 03 09:16:03 2025 -0500
@@ -4,7 +4,7 @@
 */
 
 use crate::euclidean::*;
-use crate::instance::{BasicDecomposition, Instance, Ownable};
+use crate::instance::{BasicDecomposition, Instance, MyCow, Ownable};
 use crate::linops::{Linear, Mapping, VectorSpace, AXPY};
 use crate::mapping::Space;
 use crate::maputil::{map1, map1_mut, map2, map2_mut, FixedLength, FixedLengthMut};
@@ -40,6 +40,14 @@
     fn clone_owned(&self) -> Self::OwnedVariant {
         self.clone()
     }
+
+    /// Returns an owned instance of a reference.
+    fn cow_owned<'b>(self) -> MyCow<'b, Self::OwnedVariant>
+    where
+        Self: 'b,
+    {
+        MyCow::Owned(self)
+    }
 }
 
 impl<F: Display, const N: usize> Display for Loc<N, F> {

mercurial