We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Borrow(Mut)
1 parent df73e41 commit d6d47eaCopy full SHA for d6d47ea
1 file changed
tests/mod.rs
@@ -88,6 +88,14 @@ fn borrow_identity() {
88
assert_eq!(&array, array_ref);
89
}
90
91
+#[test]
92
+fn borrow_slice() {
93
+ type A = Array<u8, U2>;
94
+ let array: A = Array([1, 2]);
95
+ let slice: &[u8] = array.borrow();
96
+ assert_eq!(array.as_slice(), slice);
97
+}
98
+
99
#[test]
100
fn borrow_mut_identity() {
101
type A = Array<u8, U2>;
@@ -104,6 +112,14 @@ fn borrow_mut_core_array() {
104
112
assert_eq!(&[1, 2], array_ref);
105
113
106
114
115
116
+fn borrow_mut_slice() {
117
118
+ let mut array: A = Array([1, 2]);
119
+ let slice: &mut [u8] = array.borrow_mut();
120
+ assert_eq!(&[1, 2], slice);
121
122
107
123
108
124
fn cast_slice_from_core() {
109
125
0 commit comments