Skip to content

Commit a7df455

Browse files
committed
Merge pull request sfackler#4 from zr40/master
Fix for upstream changes
2 parents 6bdae36 + 3216821 commit a7df455

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ documentation = "https://sfackler.github.io/rust-postgres-array/doc/postgres_arr
99

1010
[dependencies]
1111
postgres = "0.7.1"
12-
byteorder = "0.2.11"
12+
byteorder = "0.3"
1313

1414
[dev-dependencies]
1515
rustc-serialize = "0.3"

src/impls/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<T> FromSql for ArrayBase<Option<T>> where T: FromSql {
1919
let _element_type: Oid = try!(raw.read_u32::<BigEndian>());
2020

2121
let mut dim_info = Vec::with_capacity(ndim);
22-
for _ in range(0, ndim) {
22+
for _ in (0..ndim) {
2323
dim_info.push(DimensionInfo {
2424
len: try!(raw.read_u32::<BigEndian>()) as usize,
2525
lower_bound: try!(raw.read_i32::<BigEndian>()) as isize,
@@ -28,11 +28,11 @@ impl<T> FromSql for ArrayBase<Option<T>> where T: FromSql {
2828
let nele = if dim_info.len() == 0 {
2929
0
3030
} else {
31-
dim_info.iter().map(|info| info.len as usize).product()
31+
dim_info.iter().map(|info| info.len).product()
3232
};
3333

3434
let mut elements = Vec::with_capacity(nele);
35-
for _ in range(0, nele) {
35+
for _ in (0..nele) {
3636
let len = try!(raw.read_i32::<BigEndian>());
3737
if len < 0 {
3838
elements.push(None);

src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Multi-dimensional arrays with per-dimension specifiable lower bounds
22
#![doc(html_root_url="https://sfackler.github.io/rust-postgres-array/doc")]
3-
#![feature(core, io)]
3+
#![feature(core)]
44

55
#[macro_use(to_sql_checked)]
66
extern crate postgres;
@@ -362,23 +362,23 @@ mod tests {
362362
}
363363

364364
#[test]
365-
#[should_fail]
365+
#[should_panic]
366366
fn test_get_2d_fail() {
367367
let mut a = ArrayBase::from_vec(vec!(0i32, 1, 2), -1);
368368
a.wrap(1);
369369
a.get(1);
370370
}
371371

372372
#[test]
373-
#[should_fail]
373+
#[should_panic]
374374
fn test_2d_slice_range_fail_low() {
375375
let mut a = ArrayBase::from_vec(vec!(0i32, 1, 2), -1);
376376
a.wrap(1);
377377
a.slice(0);
378378
}
379379

380380
#[test]
381-
#[should_fail]
381+
#[should_panic]
382382
fn test_2d_slice_range_fail_high() {
383383
let mut a = ArrayBase::from_vec(vec!(0i32, 1, 2), -1);
384384
a.wrap(1);
@@ -396,22 +396,22 @@ mod tests {
396396
}
397397

398398
#[test]
399-
#[should_fail]
399+
#[should_panic]
400400
fn test_push_move_wrong_lower_bound() {
401401
let mut a = ArrayBase::from_vec(vec!(1i32), -1);
402402
a.push_move(ArrayBase::from_vec(vec!(2), 0));
403403
}
404404

405405
#[test]
406-
#[should_fail]
406+
#[should_panic]
407407
fn test_push_move_wrong_dims() {
408408
let mut a = ArrayBase::from_vec(vec!(1i32), -1);
409409
a.wrap(1);
410410
a.push_move(ArrayBase::from_vec(vec!(1, 2), -1));
411411
}
412412

413413
#[test]
414-
#[should_fail]
414+
#[should_panic]
415415
fn test_push_move_wrong_dim_count() {
416416
let mut a = ArrayBase::from_vec(vec!(1i32), -1);
417417
a.wrap(1);
@@ -472,14 +472,14 @@ mod tests {
472472
}
473473

474474
#[test]
475-
#[should_fail]
475+
#[should_panic]
476476
fn test_base_overslice() {
477477
let a = ArrayBase::from_vec(vec!(1i32), 0);
478478
a.slice(0);
479479
}
480480

481481
#[test]
482-
#[should_fail]
482+
#[should_panic]
483483
fn test_slice_overslice() {
484484
let mut a = ArrayBase::from_vec(vec!(1i32), 0);
485485
a.wrap(0);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy