Skip to content

Commit 4466e0c

Browse files
committed
Correct documentation for Array::copy and Clone trait
1 parent c71b60c commit 4466e0c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/array.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ impl Array {
296296

297297
/// Makes an copy of the Array
298298
///
299-
/// Internally, this is handled by reference counting
299+
/// This does a deep copy of the data into a new Array
300300
pub fn copy(&self) -> Array {
301301
unsafe {
302302
let mut temp: i64 = 0;
@@ -383,7 +383,14 @@ impl From<i64> for Array {
383383
}
384384
}
385385

386-
/// Used for incrementing the reference count of Array's native resource
386+
/// Returns a new Array object after incrementing the reference count of native resource
387+
///
388+
/// Cloning an Array does not do a deep copy of the underlying array data. It increments the
389+
/// reference count of native resource and returns you the new reference in the form a new Array
390+
/// object.
391+
///
392+
/// To create a deep copy use
393+
/// [copy()](http://arrayfire.org/arrayfire-rust/arrayfire/struct.Array.html#method.copy)
387394
impl Clone for Array {
388395
fn clone(&self) -> Array {
389396
unsafe {

0 commit comments

Comments
 (0)