Skip to content

Commit 96ab292

Browse files
ma2bd9prady9
authored andcommitted
[core] Remove trait bound af::HasEnum on struct definition and Drop impl for Array<T>
1 parent 26c8a04 commit 96ab292

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core/array.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,10 @@ extern "C" {
143143

144144
/// A multidimensional data container
145145
///
146-
/// Currently, Array objects can store only data until four dimensions
146+
/// Currently, `Array<T>` objects support data up to four dimensions.
147+
///
148+
/// All operations on arrays (including creation) require that `T: HasAfEnum`,
149+
/// meaning that `T` must be one of the numerical datatypes supported by Arrayfire.
147150
///
148151
/// ## Sharing Across Threads
149152
///
@@ -161,7 +164,7 @@ extern "C" {
161164
/// All operators(traits) from std::ops module implemented for Array object
162165
/// carry out element wise operations. For example, `*` does multiplication of
163166
/// elements at corresponding locations in two different Arrays.
164-
pub struct Array<T: HasAfEnum> {
167+
pub struct Array<T> {
165168
handle: af_array,
166169
/// The phantom marker denotes the
167170
/// allocation of data on compute device
@@ -707,10 +710,7 @@ where
707710
}
708711

709712
/// To free resources when Array goes out of scope
710-
impl<T> Drop for Array<T>
711-
where
712-
T: HasAfEnum,
713-
{
713+
impl<T> Drop for Array<T> {
714714
fn drop(&mut self) {
715715
unsafe {
716716
let ret_val = af_release_array(self.handle);

0 commit comments

Comments
 (0)