This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More to
into_mut
implementations (#801)
- Loading branch information
Showing
4 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use arrow2::array::Utf8Array; | ||
|
||
#[test] | ||
#[allow(clippy::redundant_clone)] | ||
fn array_to_mutable() { | ||
let array = Utf8Array::<i32>::from(&[Some("hello"), Some(" "), None]); | ||
let mutable = array.into_mut().unwrap_right(); | ||
|
||
let array: Utf8Array<i32> = mutable.into(); | ||
let array2 = array.clone(); | ||
let maybe_mut = array2.into_mut(); | ||
// the ref count is 2 we should not get a mutable. | ||
assert!(maybe_mut.is_left()) | ||
} |