Skip to content

Commit a6e5afe

Browse files
committed
Allow boxed traits
1 parent cd5475d commit a6e5afe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ pub trait AsFeatureMatrix {
1717
fn row(&self, row: usize) -> &[f32];
1818
}
1919

20+
impl AsFeatureMatrix for Box<dyn AsFeatureMatrix> {
21+
fn row(&self, row: usize) -> &[f32] {
22+
(**self).row(row)
23+
}
24+
}
25+
2026
#[cfg(feature = "ncnn")]
2127
impl AsFeatureMatrix for ncnn_rs::Mat {
2228
fn row(&self, row: usize) -> &[f32] {

0 commit comments

Comments
 (0)