Skip to content

Commit

Permalink
make crate no_std supporting for nalgebra -> ndarray use case
Browse files Browse the repository at this point in the history
  • Loading branch information
vadixidav committed Feb 3, 2022
1 parent 06e337e commit cd4a5c0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description = "Conversion between n-dimensional types in different Rust crates"
documentation = "https://docs.rs/nshare/"
repository = "https://github.com/rust-cv/nshare"
keywords = ["ndarray", "nalgebra", "image", "convert", "borrow"]
categories = ["rust-patterns"]
categories = ["rust-patterns", "no-std"]
license = "MIT"
readme = "README.md"

Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![no_std]

#[cfg(feature = "nalgebra")]
mod tonalgebra;
#[cfg(feature = "nalgebra")]
Expand Down
2 changes: 1 addition & 1 deletion src/tonalgebra/ndarray_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
use super::*;

use core::convert::TryFrom;
use nalgebra::Dynamic as Dy;
use std::convert::TryFrom;

/// ```
/// use nshare::ToNalgebra;
Expand Down
6 changes: 5 additions & 1 deletion src/tondarray/image_impl.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
//! Implementations for conversions from image types to ndarray types.
use super::*;
use core::ops::{Deref, DerefMut};
use image::{flat::SampleLayout, ImageBuffer, Luma, Pixel, Primitive};
use ndarray::{Array2, Array3, ArrayView2, ArrayView3, ArrayViewMut2, ArrayViewMut3, ShapeBuilder};
use std::ops::{Deref, DerefMut};

extern crate alloc;

use alloc::vec::Vec;

/// ```
/// use image::GrayImage;
Expand Down

0 comments on commit cd4a5c0

Please sign in to comment.