Skip to content

Commit 4ab1cd3

Browse files
committed
Another test and minor cleanup
1 parent 9a4b51e commit 4ab1cd3

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ types. The driver currently supports the following conversions:
257257
<td>TSRANGE, TSTZRANGE</td>
258258
</tr>
259259
<tr>
260-
<td>types::array::ArrayBase&lt;i32&gt;</td>
260+
<td>types::array::ArrayBase&lt;Option&lt;i32&gt;&gt;</td>
261261
<td>INT4[], INT4[][], ...</td>
262262
</tr>
263263
</tbody>

types/array.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<T> ArrayBase<T> {
7474
assert!(self.info.len() - 1 == other.info.len(),
7575
"Cannot append differently shaped arrays");
7676
for (info1, info2) in self.info.iter().skip(1).zip(other.info.iter()) {
77-
assert!(info1 == info2, "Cannot append differently shaped arrays");
77+
assert!(info1 == info2, "Cannot join differently shaped arrays");
7878
}
7979
self.info[0].len += 1;
8080
self.data.push_all_move(other.data);
@@ -279,4 +279,16 @@ mod tests {
279279
assert_eq!(&6, s2.get(0));
280280
assert_eq!(&7, s2.get(1));
281281
}
282+
283+
#[test]
284+
fn test_mut() {
285+
let mut a = ArrayBase::from_vec(~[1, 2], 0);
286+
a.wrap(0);
287+
{
288+
let mut s = a.slice_mut(0);
289+
*s.get_mut(0) = 3;
290+
}
291+
let s = a.slice(0);
292+
assert_eq!(&3, s.get(0));
293+
}
282294
}

0 commit comments

Comments
 (0)