# HG changeset patch # User Tuomo Valkonen # Date 1756951427 18000 # Node ID 102421d462d1158a054535cfcbfabfb3a31cb37d # Parent 73608862ef54f9be78e47414b1a1b177f2b5d1be No either diff -r 73608862ef54 -r 102421d462d1 src/instance.rs --- a/src/instance.rs Wed Sep 03 20:52:21 2025 -0500 +++ b/src/instance.rs Wed Sep 03 21:03:47 2025 -0500 @@ -344,20 +344,6 @@ X: 'b, Self: 'b; - #[inline] - /// Evaluates `f` or `g` depending on whether a reference or owned value is available. - fn either<'b, R>( - self, - f: impl FnOnce(D::Decomposition<'b>) -> R, - _g: impl FnOnce(D::Reference<'b>) -> R, - ) -> R - where - X: 'b, - Self: 'b, - { - self.eval_decompose(f) - } - /// Returns an owned instance of `X`, cloning or converting non-true instances when necessary. fn own(self) -> X::Principal; @@ -387,14 +373,6 @@ impl Instance for X { #[inline] - fn either<'b, R>(self, f: impl FnOnce(MyCow<'b, X>) -> R, _g: impl FnOnce(&'b X) -> R) -> R - where - Self: 'b, - { - f(MyCow::Owned(self)) - } - - #[inline] fn eval_ref<'b, R>(&'b self, f: impl FnOnce(&'b X) -> R) -> R where X: 'b, @@ -427,14 +405,6 @@ impl<'a, X: Space> Instance for &'a X { #[inline] - fn either<'b, R>(self, _f: impl FnOnce(MyCow<'b, X>) -> R, g: impl FnOnce(&'b X) -> R) -> R - where - Self: 'b, - { - g(self) - } - - #[inline] fn eval_ref<'b, R>(&'b self, f: impl FnOnce(&'b X) -> R) -> R where X: 'b, @@ -467,14 +437,6 @@ impl<'a, X: Space> Instance for &'a mut X { #[inline] - fn either<'b, R>(self, _f: impl FnOnce(MyCow<'b, X>) -> R, g: impl FnOnce(&'b X) -> R) -> R - where - Self: 'b, - { - g(self) - } - - #[inline] fn eval_ref<'b, R>(&'b self, f: impl FnOnce(&'b X) -> R) -> R where X: 'b, @@ -507,14 +469,6 @@ impl<'a, X: Space> Instance for MyCow<'a, X> { #[inline] - fn either<'b, R>(self, f: impl FnOnce(MyCow<'b, X>) -> R, _g: impl FnOnce(&'b X) -> R) -> R - where - Self: 'b, - { - f(self) - } - - #[inline] fn eval_ref<'b, R>(&'b self, f: impl FnOnce(&'b X) -> R) -> R where X: 'b, diff -r 73608862ef54 -r 102421d462d1 src/nalgebra_support.rs --- a/src/nalgebra_support.rs Wed Sep 03 20:52:21 2025 -0500 +++ b/src/nalgebra_support.rs Wed Sep 03 21:03:47 2025 -0500 @@ -146,19 +146,6 @@ ShapeConstraint: StridesOk + StridesOk, { #[inline] - fn either<'b, R>( - self, - f: impl FnOnce(MyCow<'b, OMatrix>) -> R, - _g: impl FnOnce(MatrixView<'b, E, M, K, Dyn, Dyn>) -> R, - ) -> R - where - Self: 'b, - { - // TODO: should not turn non-owned matrices into owned - f(MyCow::Owned(self.into_owned())) - } - - #[inline] fn eval_ref<'b, R>( &'b self, f: impl FnOnce(>>::Reference<'b>) -> R, @@ -203,18 +190,6 @@ DefaultAllocator: Allocator, ShapeConstraint: StridesOk + StridesOk, { - #[inline] - fn either<'b, R>( - self, - _f: impl FnOnce(MyCow<'b, OMatrix>) -> R, - g: impl FnOnce(MatrixView<'b, E, M, K, Dyn, Dyn>) -> R, - ) -> R - where - Self: 'b, - { - g(self.as_view()) - } - fn eval_ref<'b, R>( &'b self, f: impl FnOnce(>>::Reference<'b>) -> R, @@ -259,18 +234,6 @@ ShapeConstraint: StridesOk + StridesOk, { #[inline] - fn either<'b, R>( - self, - f: impl FnOnce(MyCow<'b, OMatrix>) -> R, - _g: impl FnOnce(MatrixView<'b, E, M, K, Dyn, Dyn>) -> R, - ) -> R - where - Self: 'b, - { - f(self) - } - - #[inline] fn eval_ref<'b, R>( &'b self, f: impl FnOnce(>>::Reference<'b>) -> R,