Skip to content

Commit de381c4

Browse files
committed
use AsArray for optional weights
1 parent 932fbc0 commit de381c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/umv.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,11 @@ impl<'a, T, D> CubicSmoothingSpline<'a, T, D>
237237
self
238238
}
239239

240-
pub(crate) fn with_optional_weights(mut self, weights: Option<ArrayView1<'a, T>>) -> Self {
240+
pub(crate) fn with_optional_weights<W>(mut self, weights: Option<W>) -> Self
241+
where W: AsArray<'a, T>
242+
{
243+
let weights = weights.map(|w| w.into());
244+
241245
self.invalidate();
242246
self.weights = weights;
243247
self

0 commit comments

Comments
 (0)